Clean up network namespaces on container removal

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #197
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2018-01-08 11:41:01 -05:00
committed by Atomic Bot
parent 6847636c30
commit 6baf6e461d

View File

@ -139,6 +139,11 @@ func (r *Runtime) removeContainer(c *Container, force bool) error {
return errors.Wrapf(ErrCtrStateInvalid, "cannot remove container %s as it is %s - running or paused containers cannot be removed", c.ID(), c.state.State.String()) return errors.Wrapf(ErrCtrStateInvalid, "cannot remove container %s as it is %s - running or paused containers cannot be removed", c.ID(), c.state.State.String())
} }
// Stop the container's network namespace (if it has one)
if err := r.teardownNetNS(c); err != nil {
return err
}
// Stop the container's storage // Stop the container's storage
if err := c.teardownStorage(); err != nil { if err := c.teardownStorage(); err != nil {
return err return err