diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-05-17 09:37:53 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-17 18:55:59 +0000 |
commit | 20bceb787da96741cb61e04b176fe7827c8b7070 (patch) | |
tree | 2d6e46262bf0b6b6f9c7da4dd45caa4c4a080f13 /libpod/runtime_ctr.go | |
parent | 92a9f3a21262ec29b4ad17e97bb0e8c54a355cb2 (diff) | |
download | podman-20bceb787da96741cb61e04b176fe7827c8b7070.tar.gz podman-20bceb787da96741cb61e04b176fe7827c8b7070.tar.bz2 podman-20bceb787da96741cb61e04b176fe7827c8b7070.zip |
Use container cleanup() functions when removing
Instead of manually calling the individual functions that cleanup
uses to tear down a container's resources, just call the cleanup
function to make sure that cleanup only needs to happen in one
place.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #790
Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 981f745b4..0f992822a 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -219,13 +219,8 @@ func (r *Runtime) removeContainer(c *Container, force bool) error { return errors.Wrapf(ErrCtrExists, "container %s has dependent containers which must be removed before it: %s", c.ID(), depsStr) } - // Tear down the container's cgroups (if they exist) - if err := c.cleanupCgroups(); err != nil { - return err - } - - // Stop the container's network namespace (if it has one) - if err := r.teardownNetNS(c); err != nil { + // Clean up network namespace, cgroups, mounts + if err := c.cleanup(); err != nil { return err } |