summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-01-16 10:33:01 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-02-08 13:35:37 -0500
commit66d000301ed7f4b55cfe0c577fbf4425d4006f19 (patch)
tree18017080e0ba0ee3c4f3010037e690f69a686af9
parentdc5c061cdcad2f815d9f8c0556a3e13824e6ba75 (diff)
downloadpodman-66d000301ed7f4b55cfe0c577fbf4425d4006f19.tar.gz
podman-66d000301ed7f4b55cfe0c577fbf4425d4006f19.tar.bz2
podman-66d000301ed7f4b55cfe0c577fbf4425d4006f19.zip
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 <matthew.heon@pm.me>
-rw-r--r--libpod/container_internal.go2
1 files changed, 1 insertions, 1 deletions
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