Replacing -d/--daemon with daemon command. Implementation of 'docker daemon' command#10535
Replacing -d/--daemon with daemon command. Implementation of 'docker daemon' command#10535shishir-a412ed wants to merge 1 commit intomoby:masterfrom
Conversation
docker/docker.go
Outdated
There was a problem hiding this comment.
This isn't backwards compatible. Consider sudo docker -g ./graph -p ./d.pid -d.
There was a problem hiding this comment.
Can you elaborate ? All we are doing is replacing '-d/--daemon' with 'daemon' keyword. So that docker daemon is started using sudo docker daemon rather than sudo docker -d
87f94f2 to
89d67ce
Compare
|
@aidanhs |
|
@aidanhs The problem we have now, is users specifying commands that are only appropriate for the --daemon on other commands, and the tool silently allowing it. Users expect something to happen, and have no idea why it did not. -d needs to die. |
|
I absolutely agree that However, it's pretty easy to retain full backwards compat for a few releases - in the loop I've commented on, if you see a Alternatively, drop support for |
|
@aidanhs It works as long as we pass the arguments at the right place. We are not completely removing -d / --daemon to give users some head ups, as this command is deprecated and will be removed in near future. I have seen this before with other docker commands. |
|
Jenkins failed on |
|
@shishir-a412ed Change the patch to put the daemin to the front and @aidanhs will be happy and we will be backwards compatible. |
|
@thaJeztah Yes that is strange, possible jenkens is a little hosed up. |
docker/docker.go
Outdated
There was a problem hiding this comment.
to be backwards compatible, daemon should always become the first argument, even if -d was passed as the x-th argument. The other arguments should be re-ordered to come after daemon
There was a problem hiding this comment.
Actually, realisation that this suggestion isn't sufficient - see #10535 (comment) below.
i.e. you make it impossible to pass global-level arguments if you shuffle the daemon command to the front.
If #10453 was merged, then this PR was rebased on top of it, we'd have a reliable way of actually filtering os.Args into two lists: global args and daemon args. Without it we're still treating api-enable-cors as a global arg when this PR gets merged, which is wrong.
89d67ce to
e2cef39
Compare
There was a problem hiding this comment.
Not sure; should the older API docs also be updated? It's a bit of a difficult case; newer docker versions support the older API, whereas older docker versions won't support the new daemon command.
If the -d backwards compatibility stays in (for the time being), I think the older API docs should not be updated, or should mention both forms (-d / daemon).
Probably best to get some feedback from a doc maintainers for this.
|
I think you need a rebase it is failing on context errors https://jenkins.dockerproject.com/job/Docker-PRs2/4/console |
|
@jfrazelle I just rebased 2 mins ago. |
|
you can see the logs that are failing in the link |
|
I think what's missing in the PR is updates to the completion scripts. According to this: #10416 (comment), updating the The bash completions (found here) need to be updated manually. You could ask @albers if he's willing to assist, but I think it's best to first see if the maintainers are willing to approve the PR first. Not sure about the zsh completions, I think those have been neglected a bit. |
|
If this is going to be accepted, I'd like to take over the bash completion part. @thaJeztah Thanks for pointing me to this. |
|
@shishir-a412ed Thanks for your contribution! I also prefer having |
|
@tiborvass should this be labeled as "proposal"? WRT backwards compatibility (also see the discussion above) I think that's almost in place, but help/usage probably changes, yes. |
|
@shishir-a412ed @thaJeztah Oh my bad, I tested with I assumed there was no backwards compat. Seems like it's just a bug in how the PR handles flags the old way. Also almost all the tests are failing, Anyway, I'll mark this as UX and it needs design approval. |
|
@tiborvass I can take a look at those errors, and also work on backward compatibility issue. A quick decision on this would be really helpful as this is pending for a long time. PR 9255. |
e2cef39 to
7799f39
Compare
These were small changes, I don't mind fixing it. However we would really appreciate if we can get this change upstream. Let me know what you guys think ? Shishir |
47943e3 to
e1b875c
Compare
docker/docker.go
Outdated
There was a problem hiding this comment.
Why not just return false here instead of this loop?
If it's not a command it's probably a misspelling of a command, so there's no point in shuffling (which we risk doing if we continue round the outer loop and hit a -d somewhere).
There was a problem hiding this comment.
We need the loop to check if we have hit a command, so that we can return and go no further.
to make sure -d is not an argument to a command and is a daemon start (-d/--daemon) which requires shuffling.
There was a problem hiding this comment.
Ok, let me explain by giving a concrete example: docker rnu myimage cmd -a -b -c -d.
Clearly this is a misspelling of the run command. Unfortunately, because you only check for real subcommands, this will be (incorrectly) identified as a command to shuffle into a daemon command.
My proposal is: as soon as you find any argument which isn't a daemon or global argument we should assume that this is not a daemon subcommand. This correctly handles a) valid subcommands b) misspelled subcommands.
|
@rhatdan |
docker/docker.go
Outdated
There was a problem hiding this comment.
Minor style note that you don't need the else, you can just remove it and unindent the block.
|
Will look closer tomorrow, but looks generally good to me (at least shuffle and checkDaemon do, which are what I'm mainly interested in). |
…daemon' command Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
|
@tiborvass any updates on this? I have added the test cases as well. |
|
Thanks @shishir-a412ed I'll carry this PR and #11418 to get it in asap. |
|
@tiborvass can you clarify? Are you going to make this a PR as part of something else? Is there anywhere to track progress? Just not quite sure what's happened to this PR... |
|
@aidanhs What is means is that we want the feature, but not in its current form: @tiborvass will take on @shishir-a412ed and make the required changes to get it merged. |
|
@icecrime Can you please elaborate a little bit ? |
|
I'm mainly interested in how I can follow progress, given @tiborvass probably has quite a few other things on his plate as well. |
|
@tiborvass @crosbymichael @jfrazelle Has this patch been moved somewhere in a new pull request that we can view? Usually when you guys do this you refer to a new pull request where we can comment and continue to contribute. We have been working on this pull request for over a year and just having it dissapear is not supporting the community. |
|
I think @tiborvass is working on a new PR but its not been submitted yet. |
|
@duglin I agree it's a bit confusing though to "carry" without opening a new PR; it makes people nervous. Perhaps just opening a placeholder "WIP" PR would have kept people at ease :) |
|
Any update? Two week silence? |
|
@tiborvass |
|
I agree, this is VERY contributor unfriendly. To say you are taking over a patch set and then going radio silent... |
|
I sincerely apologize to @shishir-a412ed and everyone on this thread, this was 100% my fault. I'll make sure not to do this again. Here's the PR #13771 I just opened, it was dependent on #13636 that just got merged. I welcome your feedback there on #13771. Thanks |
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com