mirror of
https://github.com/containers/podman.git
synced 2025-07-02 00:30:00 +08:00
checkpoint: change runtime checkpoint support test
Podman was checking if the runtime support checkpointing by running 'runtime checkpoint -h'. That works for runc. crun, however, does not use '-h, --help' for help output but, '-?, --help'. This commit switches both checkpoint support detection from 'runtime checkpoint -h' to 'runtime checkpoint --help'. Podman can now correctly detect if 'crun' also support checkpointing. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
@ -939,7 +939,7 @@ func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options Container
|
|||||||
func (r *ConmonOCIRuntime) SupportsCheckpoint() bool {
|
func (r *ConmonOCIRuntime) SupportsCheckpoint() bool {
|
||||||
// Check if the runtime implements checkpointing. Currently only
|
// Check if the runtime implements checkpointing. Currently only
|
||||||
// runc's checkpoint/restore implementation is supported.
|
// runc's checkpoint/restore implementation is supported.
|
||||||
cmd := exec.Command(r.path, "checkpoint", "-h")
|
cmd := exec.Command(r.path, "checkpoint", "--help")
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
podmanTest.SeedImages()
|
podmanTest.SeedImages()
|
||||||
// Check if the runtime implements checkpointing. Currently only
|
// Check if the runtime implements checkpointing. Currently only
|
||||||
// runc's checkpoint/restore implementation is supported.
|
// runc's checkpoint/restore implementation is supported.
|
||||||
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "-h")
|
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
Skip("OCI runtime does not support checkpoint/restore")
|
Skip("OCI runtime does not support checkpoint/restore")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user