mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Fix removing running containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #68 Approved by: rhatdan
This commit is contained in:
@ -103,6 +103,11 @@ func (r *Runtime) RemoveContainer(c *Container, force bool) error {
|
||||
if err := r.ociRuntime.stopContainer(c, ctrRemoveTimeout); err != nil {
|
||||
return errors.Wrapf(err, "cannot remove container %s as it could not be stopped", c.ID())
|
||||
}
|
||||
|
||||
// Need to update container state to make sure we know it's stopped
|
||||
if err := c.syncContainer(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if !(c.state.State == ContainerStateConfigured ||
|
||||
c.state.State == ContainerStateCreated ||
|
||||
c.state.State == ContainerStateStopped) {
|
||||
|
Reference in New Issue
Block a user