소스 검색

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>
Brielle Broder 7 년 전
부모
커밋
db621eb7ee
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      libcontainerd/client_daemon.go

+ 5 - 1
libcontainerd/client_daemon.go

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