1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Brielle Broder 2018-06-27 17:53:12 -07:00 committed by Vincent Demeester
parent 1ef1cc8388
commit db621eb7ee
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -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)
}