client: fix tasks with PID 0 cannot be forced to delete
Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
This commit is contained in:
parent
cbb2fc78e9
commit
efd4415062
@ -151,6 +151,12 @@ type ProcessDeleteOpts func(context.Context, Process) error
|
||||
|
||||
// WithProcessKill will forcefully kill and delete a process
|
||||
func WithProcessKill(ctx context.Context, p Process) error {
|
||||
// Skip killing tasks with PID 0
|
||||
// https://github.com/containerd/containerd/issues/10441
|
||||
if p.Pid() == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
// ignore errors to wait and kill as we are forcefully killing
|
||||
|
Loading…
Reference in New Issue
Block a user