-
Notifications
You must be signed in to change notification settings - Fork 559
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
Add the all option to kill operation #1190
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe Kill(containerID, signal, all)
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.
Good idea. I have updated it.
e1ebe38
to
7fe4d32
Compare
runtime.md
Outdated
@@ -135,6 +135,11 @@ This operation MUST [generate an error](#errors) if it is not provided the conta | |||
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 <container-id> <signal> <all>` |
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.
### <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have picked up the first one. Thanks 😍
s/command/operation/ |
Signed-off-by: utam0k <k0ma@utam0k.jp>
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 |
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.
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
--all
option 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.