-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename a existing container #8570
Conversation
cb27f73
to
73a69ac
Compare
There are no available options. | ||
|
||
# HISTORY | ||
October 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lies! i never wrote this ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops let me see, It may be just a cut and paste issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, It is a cut and paste errors(now removed).
oh, yes, i would like this. Docs LGTM - now for an implementation question. what happens when you rename a container that has been linked to? does everything still hand together? (I presume so, but :)) |
1f39e4c
to
62892b9
Compare
About the links, they work after rename, I tested them manually and also have integration tests that I can add, please let me know. I see the link is actually added to hosts file using IP address and container name is not used. |
plus you need core review, @crosbymichael @tiborvass ? |
@@ -79,6 +79,7 @@ func init() { | |||
{"ps", "List containers"}, | |||
{"pull", "Pull an image or a repository from a Docker registry server"}, | |||
{"push", "Push an image or a repository to a Docker registry server"}, | |||
{"rename", "Rename a existing container"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "an existing", here and below.
Docs LGTM from me once the grammar mistake is fixed. Ping @jamtur01 @ostezer. Still needs core review. Ping @crosbymichael @tiborvass Many thanks for the contribution. |
@brahmaroutu Thanks for your contribution. I'd like to note though that this is not a proposal (hence my editing of the title). A proposal is either in a form of an issue explaining what are the changes needed and why, OR a PR to the documentation explaining what would change if it were implemented (see #8859 as an example). Design needs to be reviewed with @shykes. Sorry if it's taking longer than expected! I'll make sure we review this in the next design review session. |
62892b9
to
e0e9507
Compare
@fredlf Sorry, I made that minor change to docs. |
No problem, and thanks! |
50c38fb
to
7712f98
Compare
7712f98
to
d06850a
Compare
Design review with @icecrime I approve |
#uxapproved |
t.Fatal(out, err) | ||
} | ||
|
||
dockerCmd(t, "kill", idA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these are needed if you deleteAllContainers
return job.Errorf("Failed to delete container %q: %v", old_name, err) | ||
} | ||
if _, err := daemon.reserveName(container.ID, new_name); err != nil { | ||
return job.Errorf("Error when allocating new name: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a major issue here, as error is returned without releasing the lock (same for the code path right above):
$ docker run --name test busybox true
$ docker rename test " "
Error response from daemon: Error when allocating new name: Invalid container name ( ), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed
FATA[0000] Error: failed to rename container named test
$ docker ps -a # Hangs (probably daemon in deadlock)
I think we should use defer container.Unlock()
to play safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added defer on Unlock. thanks for pointing it out.
Not LGTM: there is a blocking issue (see my comment). |
62ecf5c
to
3820e9d
Compare
Please let me know if I change it to the first ever PUT on Docker server, makes sense, instead of POST? |
Can we get an API maintainer input on the method to use so we can move on with this cool PR? Ping @vieux @jfrazelle! |
I would use GET parameter:
|
@vieux Can you also let me know if I should change it to PUT call? |
Sorry I meant a We don't have any PUT on the API, we use only POST, GET or DELETE to I would stay on the POST |
Closes moby#3036 Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
3820e9d
to
21a809d
Compare
LGTM |
fwiw; since I'm the one coming up with (If the need ever rises to be more "strict", I think that would require a complete review of the whole API) |
LGTM |
No API bump ? |
@vieux making patch now |
@jfrazelle thank you. |
It's easier for us when there is doc, every week we can look and see if we need to add the new endpoints in swarm. |
@jfrazelle thanks, let me know if I can help. |
The "or rename" part was removed from the error-message, because renaming wasn't possible at the time. Now that moby#8570 is merged, renaming existing containers is possible. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@borromeotlhs there are not many tests testing 409 and I did not add one. I can quickly add a test if you want but I need a issue to do so. |
Addresses #3036
Signed-off-by: Srini Brahmaroutu srbrahma@us.ibm.com