Update RestartPolicy of container#19116
Conversation
971d05c to
f18c8e9
Compare
|
Thanks @WeiZhang555! I guess we should look at this, together with @vdemeester's proposal for #19104 ? |
|
@thaJeztah Yes, I also noticed #19104, it hides |
@WeiZhang555 ah, great! |
|
😍 This is the thing I want to change about existing containers most often! (Usually because I was a dummy and forgot to specify one on an important container...) |
f18c8e9 to
0522fb9
Compare
|
Just made some updates to adapt newly introduced @calavera Could you help vendor the I know I shouldn't add codes to Thanks! |
0522fb9 to
90544e4
Compare
|
Updated, wait for vendoring of |
90544e4 to
4b0b07f
Compare
|
I agree it's super useful, I'm just slightly confused: So |
|
@icecrime the idea was to have |
|
@icecrime @tiborvass said it all 👍 |
|
OK, moving to code review I guess 😉 |
There was a problem hiding this comment.
lower case maximumRetryCount, err := please
|
Do you have a PR into engine-api already? |
|
@cpuguy83 Yes, I just checked and found that it's already merged and vendored, I'll do a rebase to make use of it. |
4b0b07f to
fe9f81b
Compare
|
Updated. |
There was a problem hiding this comment.
This one is flakey because the container is not going to be running for a very long time so it may be difficult to catch (And is probably why it's currently failed on gccgo).
Maybe checking just the RestartCount hits 5, like below, and then verify that it is in a stopped state.
There was a problem hiding this comment.
Hmm, checking RestartCount hits 5 may bring new problem, if docker update fails to update the RestartPolicy of a running container, it will never hits 5...Besides that, we still need to waitInspect the RestartCount in timeout.
I'll try to give it a larger timeout, maybe 60 seconds? If the container can't stop in 60 seconds, I think some real problem happens.
|
Ping @thaJeztah @moxiegirl for docs review. |
|
The docs should explain what |
|
@calavera OK, I'll change the docs together with @thaJeztah / @moxiegirl 's review result. |
There was a problem hiding this comment.
I think "update configuration of one or more containers" ("configuration" instead of "configs")
|
Some nits, but overall looking good. Can you add a mention to the API changes; https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api.md#v123-api-changes ? |
Add `--restart` flag for `update` command, so we can change restart policy for a container no matter it's running or stopped. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
d5a4bf9 to
ff3ea4c
Compare
|
Job: Docker-PRs-WoW-TP4 FAILED: ---
0T09:09:03Z" level=error msg="hcsshim::DestroyLayer - Win32 API call returned error r1=0x80070020 err=The process cannot access the file because it is being used by another process.id=CI flavour=0"
ERROR: hcsshim::DestroyLayer - Win32 API call returned error r1=0x80070020 err=The process cannot access the file because it is being used by another process.id=CI flavour=0
INFO: End of cleanup
INFO: Ended at Sat Feb 20 09:09:03 CUT 2016 (1m 23s)
Build step 'Execute shell' marked build as failure
[PostBuildScript] - Execution post build scripts.
[docker] $ sh -xe C:\Users\jenkins\hudson8046814883113902440.sh
+ set +e
+ set +x
INFO: Nuking /d/CI
time="2016-02-20T09:09:07Z" level=error msg="hcsshim::DestroyLayer - Win32 API call returned error r1=0x80070020 err=The process cannot access the file because it is being used by another process.id=CI flavour=0"
ERROR: hcsshim::DestroyLayer - Win32 API call returned error r1=0x80070020 err=The process cannot access the file because it is being used by another process.id=CI flavour=0
INFO: End
---
|
|
@thaJeztah update, PTAL. |
|
Thanks @WeiZhang555, LGTM ping @vdemeester ptal |
|
LGTM 🐼 |
Update RestartPolicy of container
|
Woohoo! 🎉 love this feature 😄 |
|
Finally! 🎉 |
Fixes #19025
Add
--restartflag forupdatecommand, so we can change restartpolicy for a running/stopped container.
Signed-off-by: Zhang Wei zhangwei555@huawei.com