Add the all option to kill operation#1190
Conversation
AkihiroSuda
left a comment
There was a problem hiding this comment.
L95:
Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations.
@AkihiroSuda Thanks for your review 🙏 |
| #### <a name="runtimeKillAll" />KillAll | ||
|
|
||
| - `--all` Kill all the processes in the container. | ||
|
|
There was a problem hiding this comment.
kill-all <container-id> <signal>, or kill <container-id> <signal> <all> to clarify that this is not a CLI specification
There was a problem hiding this comment.
Or maybe Kill(containerID, signal, all)
There was a problem hiding this comment.
Good idea. I have updated it.
e1ebe38 to
7fe4d32
Compare
runtime.md
Outdated
| This operation MUST send the specified signal to the container process. | ||
|
|
||
| ### <a name="runtimeKillAll" />KillAll | ||
| `kill <container-id> <signal> <all>` |
There was a problem hiding this comment.
### <a name="runtimeKill" />Kill
`kill <container-id> <signal> <all>`
This operation MUST [generate an error](#errors) if it is not provided the container ID.
Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors).
This operation MUST send the specified signal to the container process.
If `<all>` is `true`, all the processes in the container are killed.Or:
### <a name="runtimeKill" />Kill
`kill <container-id> <signal>
This operation MUST [generate an error](#errors) if it is not provided the container ID.
Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors).
This operation MUST send the specified signal to the container process.
### <a name="runtimeKillAll" />KillAll
`kill-all <container-id> <signal>`
Kill all the processes in the container.There was a problem hiding this comment.
I have picked up the first one. Thanks 😍
s/command/operation/ |
Signed-off-by: utam0k <[email protected]>
Indeed 👍 |
|
@kolyshkin What should we do with this spec PR? |
|
@opencontainers/runtime-spec-maintainers @lifubang PTAL |
|
To my mind,
1. Killing the container (
|
|
I agree with @kolyshkin. I think I spoke with @brauner about |
cyphar
left a comment
There was a problem hiding this comment.
As discussed, I don't think this is necessary (regardless of whether runc kill -a exists -- but it has also been removed).
|
I can follow runc's decision if runc drops it 👌 I just want to align the runtime-spec to reality in this PR. Youki use this way to implement it actually.
I agree with you.
@AkihiroSuda @kolyshkin @cyphar Thanks for your review 🙏 |
|
@giuseppe FYI 👀 I guess this decision affects crun in the future.
|
Since the
--alloption is already used a lot, why not include it in the specification?https://github.com/containerd/go-runc/blob/f5d58d02d6c8d10b17786c1da74e72aed01d4dfb/runc.go#L375-L378
https://github.com/cri-o/cri-o/blob/488d8823f507fe7fb7c9041ed55ae957762b874c/internal/oci/runtime_oci.go#L1133-L1138
All of runc/crun/youki supported this option.