libcontainerd/client: Fix checkpoint not being set
`cp` variable is used later to populate the `info.Checkpoint` field option used by Task creation. Previous changes mistakenly changed assignment of the `cp` variable to declaration of a new variable that's scoped only to the if block. Restore the old assignment behavior. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
a48f19157a
commit
0c751f904f
1 changed files with 2 additions and 1 deletions
|
@ -154,7 +154,8 @@ func (c *container) Start(ctx context.Context, checkpointDir string, withStdin b
|
||||||
if checkpointDir != "" {
|
if checkpointDir != "" {
|
||||||
// write checkpoint to the content store
|
// write checkpoint to the content store
|
||||||
tar := archive.Diff(ctx, "", checkpointDir)
|
tar := archive.Diff(ctx, "", checkpointDir)
|
||||||
cp, err := c.client.writeContent(ctx, images.MediaTypeContainerd1Checkpoint, checkpointDir, tar)
|
var err error
|
||||||
|
cp, err = c.client.writeContent(ctx, images.MediaTypeContainerd1Checkpoint, checkpointDir, tar)
|
||||||
// remove the checkpoint when we're done
|
// remove the checkpoint when we're done
|
||||||
defer func() {
|
defer func() {
|
||||||
if cp != nil {
|
if cp != nil {
|
||||||
|
|
Loading…
Reference in a new issue