Fix checkpoint's exiting semantics.
Previously, dockerd would always ask containerd to pass --leave-running to runc/runsc, ignoring the exit boolean value. Hence, even `docker checkpoint create --leave-running=false ...` would not stop the container. Signed-off-by: Brielle Broder <bbroder@google.com> Upstream-commit: db621eb7ee6a837f6879959ac56c67fa2b30ae1d Component: engine
This commit is contained in:
committed by
Vincent Demeester
parent
19f93d0875
commit
6817733c2a
@@ -561,7 +561,11 @@ func (c *client) CreateCheckpoint(ctx context.Context, containerID, checkpointDi
|
||||
return err
|
||||
}
|
||||
|
||||
img, err := p.(containerd.Task).Checkpoint(ctx)
|
||||
opts := []containerd.CheckpointTaskOpts{}
|
||||
if exit {
|
||||
opts = append(opts, containerd.WithExit)
|
||||
}
|
||||
img, err := p.(containerd.Task).Checkpoint(ctx, opts...)
|
||||
if err != nil {
|
||||
return wrapError(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user