From ab5d93187c224d66ce3d5486aff75dd7084a1274 Mon Sep 17 00:00:00 2001 From: Jakob Date: Tue, 8 Sep 2020 18:29:13 +0200 Subject: [PATCH] cr: fix checkpoint from image getting skipped Fix restoring from a checkpoint image always getting skipped when no checkpoint image path is set. As one restores either from an image OR a path, this makes no sense. Signed-off-by: Jakob Schrettenbrunner --- services/tasks/local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/tasks/local.go b/services/tasks/local.go index 340cdf4b8..632bd5080 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -148,7 +148,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc. return nil, err } // jump get checkpointPath from checkpoint image - if checkpointPath != "" && r.Checkpoint != nil { + if checkpointPath == "" && r.Checkpoint != nil { checkpointPath, err = ioutil.TempDir(os.Getenv("XDG_RUNTIME_DIR"), "ctrd-checkpoint") if err != nil { return nil, err