mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user