Add KillOpts for killing all processes
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>
This commit is contained in:
14
task_opts.go
14
task_opts.go
@@ -51,3 +51,17 @@ func WithProcessKill(ctx context.Context, p Process) error {
|
||||
<-s
|
||||
return nil
|
||||
}
|
||||
|
||||
type KillInfo struct {
|
||||
// All kills all processes inside the task
|
||||
// only valid on tasks, ignored on processes
|
||||
All bool
|
||||
}
|
||||
|
||||
type KillOpts func(context.Context, Process, *KillInfo) error
|
||||
|
||||
// WithKillAll kills all processes for a task
|
||||
func WithKillAll(ctx context.Context, p Process, i *KillInfo) error {
|
||||
i.All = true
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user