summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-10-25 13:28:19 -0400
committerMatthew Heon <matthew.heon@gmail.com>2018-11-07 11:36:01 -0500
commit94763a47a6e86ccf13d8a3ded3365f9c4440a668 (patch)
treede06f80d6ae060e3807a63f389c44dd08c4e5357 /libpod/oci.go
parent140f87c474f5a075d5833335593895491b83dab6 (diff)
downloadpodman-94763a47a6e86ccf13d8a3ded3365f9c4440a668.tar.gz
podman-94763a47a6e86ccf13d8a3ded3365f9c4440a668.tar.bz2
podman-94763a47a6e86ccf13d8a3ded3365f9c4440a668.zip
If a container ceases to exist in runc, set exit status
When we scan a container in runc and see that it no longer exists, we already set ContainerStatusExited to indicate that it no longer exists in runc. Now, also set an exit code and exit time, so PS output will make some sense. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index b390b1967..e8a97226a 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -508,6 +508,8 @@ func (r *OCIRuntime) updateContainerStatus(ctr *Container, useRunc bool) error {
}
if strings.Contains(string(out), "does not exist") {
ctr.removeConmonFiles()
+ ctr.state.ExitCode = -1
+ ctr.state.FinishedTime = time.Now()
ctr.state.State = ContainerStateExited
return nil
}