Merge pull request #24327 from rst0git/pod-restore

Enable pod restore with crun
This commit is contained in:
openshift-merge-bot[bot] 2024-10-21 18:09:30 +00:00 committed by GitHub
commit 4319fac0a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 1 deletions

View File

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