Skip to content

Commit

Permalink
Merge pull request #10639 from adrianreber/2021-06-10-pre-dump-fix
Browse files Browse the repository at this point in the history
Fix pre-checkpointing
  • Loading branch information
openshift-merge-robot authored Jun 10, 2021
2 parents 2aedcae + 240bbc3 commit 6feaae6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
// name of the directory holding the artifacts
artifactsDir = "artifacts"
execDirPermission = 0755
preCheckpointDir = "pre-checkpoint"
)

// rootFsSize gets the size of the container's root filesystem
Expand Down Expand Up @@ -141,7 +142,7 @@ func (c *Container) CheckpointPath() string {

// PreCheckpointPath returns the path to the directory containing the pre-checkpoint-images
func (c *Container) PreCheckPointPath() string {
return filepath.Join(c.bundlePath(), "pre-checkpoint")
return filepath.Join(c.bundlePath(), preCheckpointDir)
}

// AttachSocketPath retrieves the path of the container's attach socket
Expand Down
5 changes: 3 additions & 2 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,14 +909,15 @@ func (c *Container) exportCheckpoint(options ContainerCheckpointOptions) error {
includeFiles := []string{
"artifacts",
"ctr.log",
metadata.CheckpointDirectory,
metadata.ConfigDumpFile,
metadata.SpecDumpFile,
metadata.NetworkStatusFile,
}

if options.PreCheckPoint {
includeFiles[0] = "pre-checkpoint"
includeFiles = append(includeFiles, preCheckpointDir)
} else {
includeFiles = append(includeFiles, metadata.CheckpointDirectory)
}
// Get root file-system changes included in the checkpoint archive
var addToTarFiles []string
Expand Down
6 changes: 5 additions & 1 deletion libpod/oci_conmon_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options Container
args = append(args, "--pre-dump")
}
if !options.PreCheckPoint && options.WithPrevious {
args = append(args, "--parent-path", ctr.PreCheckPointPath())
args = append(
args,
"--parent-path",
filepath.Join("..", preCheckpointDir),
)
}
runtimeDir, err := util.GetRuntimeDir()
if err != nil {
Expand Down

0 comments on commit 6feaae6

Please sign in to comment.