Fix Wait() to allow Exited state as well as Stopped

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
Matthew Heon 2018-10-02 14:26:19 -04:00
parent 7e23fb6c5d
commit b7c5fa70ab
2 changed files with 2 additions and 2 deletions

View file

@ -423,7 +423,7 @@ func (c *Container) isStopped() (bool, error) {
if err != nil {
return true, err
}
return c.state.State == ContainerStateStopped, nil
return (c.state.State == ContainerStateStopped || c.state.State == ContainerStateExited), nil
}
// save container state to the database

View file

@ -457,7 +457,7 @@ func (r *OCIRuntime) updateContainerStatus(ctr *Container) error {
if err != nil {
if strings.Contains(string(out), "does not exist") {
ctr.removeConmonFiles()
ctr.state.State = ContainerStateConfigured
ctr.state.State = ContainerStateExited
return nil
}
return errors.Wrapf(err, "error getting container %s state. stderr/out: %s", ctr.ID(), out)