Skip to content

Commit

Permalink
Merge pull request containers#24327 from rst0git/pod-restore
Browse files Browse the repository at this point in the history
Enable pod restore with crun
  • Loading branch information
openshift-merge-bot[bot] authored Oct 21, 2024
2 parents e4d6fa7 + 642b61a commit 4319fac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/checkpoint/crutils/checkpoint_restore_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,18 @@ func CRRuntimeSupportsCheckpointRestore(runtimePath string) bool {
func CRRuntimeSupportsPodCheckpointRestore(runtimePath string) bool {
cmd := exec.Command(runtimePath, "restore", "--lsm-mount-context")
out, _ := cmd.CombinedOutput()
return bytes.Contains(out, []byte("flag needs an argument"))

// check for runc
if bytes.Contains(out, []byte("flag needs an argument")) {
return true
}

// check for crun
if bytes.Contains(out, []byte("requires an argument")) {
return true
}

return false
}

// CRGetRuntimeFromArchive extracts the checkpoint metadata from the
Expand Down

0 comments on commit 4319fac

Please sign in to comment.