summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-29 10:55:06 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-29 17:57:32 +0000
commit681a8c85ed31fcbf6cb3594a791deb418dbf3954 (patch)
tree1ed5c30656d1b6c160566300177bda80211045cd /libpod
parentce3081786b6573abad764ac425fb9b7c5b74c465 (diff)
downloadpodman-681a8c85ed31fcbf6cb3594a791deb418dbf3954.tar.gz
podman-681a8c85ed31fcbf6cb3594a791deb418dbf3954.tar.bz2
podman-681a8c85ed31fcbf6cb3594a791deb418dbf3954.zip
Ensure that we can't remove paused containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #85 Approved by: rhatdan
Diffstat (limited to 'libpod')
-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 {