From ed41a290a2115ff45b4ce7bfda662aa88d6d314b Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 28 Nov 2017 17:18:47 -0500 Subject: Fix removing running containers Signed-off-by: Matthew Heon Closes: #68 Approved by: rhatdan --- libpod/runtime_ctr.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpod') 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) { -- cgit v1.2.3-54-g00ecf