docker kill should return error if container is not running.#12371
docker kill should return error if container is not running.#12371duglin merged 4 commits intomoby:masterfrom
Conversation
|
I think is a dup #12085 |
|
Also #12085 (comment) |
|
We currently are returning errors from kill, so I don't agree with this statement. We can steal the unit test code from the other patch. docker kill --signal 30 MISSINGCONTAINER Currently returns an error. This change just adds docker kill --signal 30 NOTRUNNINGCONTAINER The other pull request returned error on SIGINT of a non running container, which I left as not an error, |
|
This fix is in response to a bugzilla |
There was a problem hiding this comment.
Sorry, I don't understand how this change relates to the PR? It seems it should never have been fetched from vars, but then how does kill even works today, and why is there no test to catch this?
There was a problem hiding this comment.
I think this is a real bug becuase signal comes from the GET params and not any URL segment
There was a problem hiding this comment.
Correct, when testing the fix, a patch came in that blew up our fix. So I included it in the pull request.
|
LGTM |
|
can we get some testcases for this? |
|
Added a test. |
|
@rhatdan I don't see the test, did you forget to "git add" it? |
|
@duglin oops |
There was a problem hiding this comment.
This will always error because you can't run the same cmd twice.
There was a problem hiding this comment.
it might be better to create a new test where you:
- create a container
- stop it
- try to kill it and then check for your new error message.
I think its important to make sure that we run, and verify, that the code you added is hit.
|
Ok added a new function. |
There was a problem hiding this comment.
Can you check to make sure your text is displayed? Otherwise we can't be sure we're hitting your code - it could have failed for some other reason by mistake.
There was a problem hiding this comment.
I don't think you addressed this comment yet
|
|
Ok this is broken, because we are only returning error on kill signal not on kill -9. I have fixed the test. |
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
|
@rhatdan any chance of you addressing #12371 (comment) ? |
|
@duglin I think the current pull request fails on all kill signals. |
|
ping @rhatdan any update here? |
|
@cpuguy83 I think it is all set? I have it returning errors for both kinds of kills. |
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
There was a problem hiding this comment.
I don't think this addresses the previous comment, you're not checking the output to make sure you get the new error message you're generating.
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
|
The failure looks unrelated to the pull request. |
|
Any movement on this one? Seems like a fairly simple patch to merge. |
|
LGTM |
1 similar comment
|
LGTM |
docker kill should return error if container is not running.
|
Thanks. |
|
I just want to note that here #12085 (comment) we talked about breaking Kill api and I'm just wondering if we should version this change |
|
And also with this change not only container kill changes its behavior but also delete (and stop iirc) |
Assuming that docker kill is trying to actually kill the container is a mistake. If the container is not running we should report it back to the caller as a error.
Docker-DCO-1.1-Signed-off-by: Regan McCooey [email protected] (github: rmccooey27)
Docker-DCO-1.1-Signed-off-by: Dan Walsh [email protected] (github: rhatdan)