summaryrefslogtreecommitdiff
path: root/libpod/oci_conmon_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-16 11:05:45 +0200
committerGitHub <noreply@github.com>2019-10-16 11:05:45 +0200
commit8172460f2a09910d611d2d61655fb3682caca09f (patch)
tree8569cfb4c571e215d0323614da7be563b3cfa6f6 /libpod/oci_conmon_linux.go
parent7b54aeb6e3dca3511daa1e511625f7e446fbc710 (diff)
parentcab7bfbb211f2496af9f86208588e26954fc9b2a (diff)
downloadpodman-8172460f2a09910d611d2d61655fb3682caca09f.tar.gz
podman-8172460f2a09910d611d2d61655fb3682caca09f.tar.bz2
podman-8172460f2a09910d611d2d61655fb3682caca09f.zip
Merge pull request #4273 from mheon/no_runtime
Add a MissingRuntime implementation
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r--libpod/oci_conmon_linux.go32
1 files changed, 3 insertions, 29 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 3606a9634..658a2fe4e 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -216,8 +216,8 @@ func (r *ConmonOCIRuntime) CreateContainer(ctr *Container, restoreOptions *Conta
// If useRuntime is false, we will not directly hit runc to see the container's
// status, but will instead only check for the existence of the conmon exit file
// and update state to stopped if it exists.
-func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container, useRuntime bool) error {
- exitFile, err := ctr.exitFilePath()
+func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container) error {
+ exitFile, err := r.ExitFilePath(ctr)
if err != nil {
return err
}
@@ -227,33 +227,6 @@ func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container, useRuntime bool
return err
}
- // If not using the OCI runtime, we don't need to do most of this.
- if !useRuntime {
- // If the container's not running, nothing to do.
- if ctr.state.State != define.ContainerStateRunning && ctr.state.State != define.ContainerStatePaused {
- return nil
- }
-
- // Check for the exit file conmon makes
- info, err := os.Stat(exitFile)
- if err != nil {
- if os.IsNotExist(err) {
- // Container is still running, no error
- return nil
- }
-
- return errors.Wrapf(err, "error running stat on container %s exit file", ctr.ID())
- }
-
- // Alright, it exists. Transition to Stopped state.
- ctr.state.State = define.ContainerStateStopped
- ctr.state.PID = 0
- ctr.state.ConmonPID = 0
-
- // Read the exit file to get our stopped time and exit code.
- return ctr.handleExitFile(exitFile, info)
- }
-
// Store old state so we know if we were already stopped
oldState := ctr.state.State
@@ -825,6 +798,7 @@ func (r *ConmonOCIRuntime) RuntimeInfo() (map[string]interface{}, error) {
"version": conmonVersion,
}
info["OCIRuntime"] = map[string]interface{}{
+ "name": r.name,
"path": r.path,
"package": runtimePackage,
"version": runtimeVersion,