From b7c5fa70ab858a32432a653674efcf10531048ff Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 2 Oct 2018 14:26:19 -0400 Subject: Fix Wait() to allow Exited state as well as Stopped Signed-off-by: Matthew Heon --- libpod/container_internal.go | 2 +- libpod/oci.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libpod') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index c2ed67a82..f6c8781e0 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -423,7 +423,7 @@ func (c *Container) isStopped() (bool, error) { if err != nil { return true, err } - return c.state.State == ContainerStateStopped, nil + return (c.state.State == ContainerStateStopped || c.state.State == ContainerStateExited), nil } // save container state to the database diff --git a/libpod/oci.go b/libpod/oci.go index 3838394cb..61ae4b46e 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -457,7 +457,7 @@ func (r *OCIRuntime) updateContainerStatus(ctr *Container) error { if err != nil { if strings.Contains(string(out), "does not exist") { ctr.removeConmonFiles() - ctr.state.State = ContainerStateConfigured + ctr.state.State = ContainerStateExited return nil } return errors.Wrapf(err, "error getting container %s state. stderr/out: %s", ctr.ID(), out) -- cgit v1.2.3-54-g00ecf