summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-08 11:41:01 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-08 18:45:17 +0000
commit6baf6e461de6e560cc48d35239e7c392bec4481c (patch)
tree7765bb19303ae4ac734258d8ad6f75b38ff2f4c3
parent6847636c30bb3b70882000189946cb36cc5a246a (diff)
downloadpodman-6baf6e461de6e560cc48d35239e7c392bec4481c.tar.gz
podman-6baf6e461de6e560cc48d35239e7c392bec4481c.tar.bz2
podman-6baf6e461de6e560cc48d35239e7c392bec4481c.zip
Clean up network namespaces on container removal
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #197 Approved by: rhatdan
-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 9e42ff8d1..914d457a0 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -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())
}
+ // Stop the container's network namespace (if it has one)
+ if err := r.teardownNetNS(c); err != nil {
+ return err
+ }
+
// Stop the container's storage
if err := c.teardownStorage(); err != nil {
return err