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 <dev@schrej.net>
This commit is contained in:
Jakob 2020-09-08 18:29:13 +02:00 committed by Jakob Schrettenbrunner
parent d43d546a8d
commit ab5d93187c

View File

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