summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-28 17:18:47 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-29 12:15:16 +0000
commited41a290a2115ff45b4ce7bfda662aa88d6d314b (patch)
tree9a7b30eeacd012972fc898901500d6a963eae51b /libpod/runtime_ctr.go
parent66ed73f89f532c093dd42d84e8c004421e6d2962 (diff)
downloadpodman-ed41a290a2115ff45b4ce7bfda662aa88d6d314b.tar.gz
podman-ed41a290a2115ff45b4ce7bfda662aa88d6d314b.tar.bz2
podman-ed41a290a2115ff45b4ce7bfda662aa88d6d314b.zip
Fix removing running containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #68 Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index cf669eeb4..32902d9c6 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -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) {