diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-03 02:06:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 02:06:19 -0800 |
commit | 2a3460b26dc7056189abbbfd19c1f37367fa6b6c (patch) | |
tree | f4c93b23215606fd35a292f7edfe3cb564989ac7 /libpod/oci_conmon_linux.go | |
parent | 0a40c5a059455693de0cc9a3f4a2a16722fc61e9 (diff) | |
parent | 91b2f07d5ba75cacdc8a6607fc6aed4ee4bcc9cf (diff) | |
download | podman-2a3460b26dc7056189abbbfd19c1f37367fa6b6c.tar.gz podman-2a3460b26dc7056189abbbfd19c1f37367fa6b6c.tar.bz2 podman-2a3460b26dc7056189abbbfd19c1f37367fa6b6c.zip |
Merge pull request #9521 from adrianreber/2021-02-25-checkpointctl
Reorder checkpoint/restore code for CRI-O
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r-- | libpod/oci_conmon_linux.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index de7630c06..492bc807a 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -28,6 +28,7 @@ import ( "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/logs" "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/podman/v3/pkg/checkpoint/crutils" "github.com/containers/podman/v3/pkg/errorhandling" "github.com/containers/podman/v3/pkg/lookup" "github.com/containers/podman/v3/pkg/rootless" @@ -837,16 +838,7 @@ func (r *ConmonOCIRuntime) CheckConmonRunning(ctr *Container) (bool, error) { // SupportsCheckpoint checks if the OCI runtime supports checkpointing // containers. func (r *ConmonOCIRuntime) SupportsCheckpoint() bool { - // Check if the runtime implements checkpointing. Currently only - // runc's checkpoint/restore implementation is supported. - cmd := exec.Command(r.path, "checkpoint", "--help") - if err := cmd.Start(); err != nil { - return false - } - if err := cmd.Wait(); err == nil { - return true - } - return false + return crutils.CRRuntimeSupportsCheckpointRestore(r.path) } // SupportsJSONErrors checks if the OCI runtime supports JSON-formatted error |