From 66d000301ed7f4b55cfe0c577fbf4425d4006f19 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 04d67b1aa..0284dde2f 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -531,7 +531,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