From 33889c642deaaf3d6977ea6463f5937f549fb52b Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 16 Jan 2019 10:33:01 -0500 Subject: Ensure that wait exits on state transition When waiting for a container, there is a long interval between status checks - plenty long enough for the container in question to start, then subsequently be cleaned up and returned to Created state to be restarted. As such, we can't wait on container state to go to Stopped or Exited - anything that is not Running or Paused indicates the container is dead. Signed-off-by: Matthew Heon --- libpod/container_internal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 90f4659da..ce8791f08 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -540,7 +540,7 @@ func (c *Container) isStopped() (bool, error) { if err != nil { return true, err } - return (c.state.State == ContainerStateStopped || c.state.State == ContainerStateExited), nil + return (c.state.State != ContainerStateRunning && c.state.State != ContainerStatePaused), nil } // save container state to the database -- cgit v1.2.3-54-g00ecf