mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
Ensure that we can't remove paused containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #85 Approved by: rhatdan
This commit is contained in:
parent
ce3081786b
commit
681a8c85ed
|
@ -103,6 +103,10 @@ func (r *Runtime) removeContainer(c *Container, force bool) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.state.State == ContainerStatePaused {
|
||||||
|
return errors.Wrapf("container %s is paused, cannot remove until unpaused", c.ID())
|
||||||
|
}
|
||||||
|
|
||||||
// Check that the container's in a good state to be removed
|
// Check that the container's in a good state to be removed
|
||||||
if c.state.State == ContainerStateRunning && force {
|
if c.state.State == ContainerStateRunning && force {
|
||||||
if err := r.ociRuntime.stopContainer(c, ctrRemoveTimeout); err != nil {
|
if err := r.ociRuntime.stopContainer(c, ctrRemoveTimeout); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue