summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 8613950f6..ca9b42575 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -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 {