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:
Matthew Heon 2017-11-29 10:55:06 -05:00 committed by Atomic Bot
parent ce3081786b
commit 681a8c85ed

View file

@ -103,6 +103,10 @@ func (r *Runtime) removeContainer(c *Container, force bool) error {
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
if c.state.State == ContainerStateRunning && force {
if err := r.ociRuntime.stopContainer(c, ctrRemoveTimeout); err != nil {