Merge pull request #7787 from ginglis13/restore-fail
allow client to remove created tasks with PID 0
This commit is contained in:
commit
e5751d44c4
5
task.go
5
task.go
@ -311,6 +311,11 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat
|
|||||||
// On windows Created is akin to Stopped
|
// On windows Created is akin to Stopped
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
if t.pid == 0 {
|
||||||
|
// allow for deletion of created tasks with PID 0
|
||||||
|
// https://github.com/containerd/containerd/issues/7357
|
||||||
|
break
|
||||||
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("task must be stopped before deletion: %s: %w", status.Status, errdefs.ErrFailedPrecondition)
|
return nil, fmt.Errorf("task must be stopped before deletion: %s: %w", status.Status, errdefs.ErrFailedPrecondition)
|
||||||
|
Loading…
Reference in New Issue
Block a user