From 3006db2bfe5ffc5be300907000c269ca6f0b0c21 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sat, 18 Apr 2020 18:20:34 -0700 Subject: [PATCH] checkpoint: don't print error if --pre-dump is set Obviously, either --pre-dump or --leave-running implies that we don't want to remove the container. Fixes: 87712d288 Signed-off-by: Kir Kolyshkin --- checkpoint.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/checkpoint.go b/checkpoint.go index b0ddffdeb..228b6072f 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -63,12 +63,8 @@ checkpointed.`, fatalf("Container cannot be checkpointed in %s state", status.String()) } options := criuOptions(context) - if !options.LeaveRunning || !options.PreDump { - // destroy prints out an error if we tell CRIU to - // leave the container running: - // ERRO[0000] container is not destroyed - // The message is correct, but we actually do not want - // to destroy the container in this case. + if !(options.LeaveRunning || options.PreDump) { + // destroy container unless we tell CRIU to keep it defer destroy(container) } // these are the mandatory criu options for a container