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 KillOpts for killing all processes #1434
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1434 +/- ##
======================================
Coverage 40.8% 40.8%
======================================
Files 23 23
Lines 2924 2924
======================================
Hits 1193 1193
Misses 1453 1453
Partials 278 278 Continue to review full report at Codecov.
|
task_opts.go
Outdated
All bool | ||
} | ||
|
||
type KillOpts func(context.Context, Process, *KillInfo) error |
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.
nit: Could the options just take in the KillRequest
type?
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.
No, we have been going away from exposing the protos in the client interfaces
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 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.
LGTM
ping @Random-Liu , can you take a look at this and see if it's what you had in mind? |
@@ -51,3 +51,15 @@ func WithProcessKill(ctx context.Context, p Process) error { | |||
<-s | |||
return nil | |||
} | |||
|
|||
type KillInfo struct { | |||
// All kills all processes inside the task |
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.
Probably comment that this only works for task. IIUC, exec.Kill
will just ignore this field inside the shim.
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.
done
LGTM with a nit. @crosbymichael Thanks for the quick fix! |
Fixes containerd#1431 This adds KillOpts so that a client can specify when they want to kill a single process or all the processes inside a container. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
ccf1f5a
to
ed6b8fb
Compare
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.
LGTM
Fixes #1431
This adds KillOpts so that a client can specify when they want to kill a
single process or all the processes inside a container.
Signed-off-by: Michael Crosby crosbymichael@gmail.com