File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,6 @@ checkpointed.`,
6767 return err
6868 }
6969
70- if ! (options .LeaveRunning || options .PreDump ) {
71- // destroy container unless we tell CRIU to keep it
72- defer destroy (container )
73- }
7470 // these are the mandatory criu options for a container
7571 if err := setPageServer (context , options ); err != nil {
7672 return err
@@ -81,7 +77,13 @@ checkpointed.`,
8177 if err := setEmptyNsMask (context , options ); err != nil {
8278 return err
8379 }
84- return container .Checkpoint (options )
80+
81+ err = container .Checkpoint (options )
82+ if err == nil && ! (options .LeaveRunning || options .PreDump ) {
83+ // Destroy the container unless we tell CRIU to keep it.
84+ destroy (container )
85+ }
86+ return err
8587 },
8688}
8789
You can’t perform that action at this time.
0 commit comments