summaryrefslogtreecommitdiff
path: root/libpod
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-01-16 10:33:01 -0500
commit33889c642deaaf3d6977ea6463f5937f549fb52b (patch)
treedea4aa2de60167e226de8b722b230f495f262a7a /libpod
parent1b2f75298d98f59fac73a63599cdca3478bef835 (diff)
downloadpodman-33889c642deaaf3d6977ea6463f5937f549fb52b.tar.gz
podman-33889c642deaaf3d6977ea6463f5937f549fb52b.tar.bz2
podman-33889c642deaaf3d6977ea6463f5937f549fb52b.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>
Diffstat (limited to 'libpod')
-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 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