diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-12 23:23:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 23:23:08 +0200 |
commit | 20772182e6a9f82403a668d228dfd81c8df06821 (patch) | |
tree | 7de05b12842107ac333447a06864be266b218147 /libpod | |
parent | 1ddfc11764a18815fea3a2d91ce8314c87d8e0b7 (diff) | |
parent | 7b68cd0b3d45c3d7e01b6134abaa0ece44518625 (diff) | |
download | podman-20772182e6a9f82403a668d228dfd81c8df06821.tar.gz podman-20772182e6a9f82403a668d228dfd81c8df06821.tar.bz2 podman-20772182e6a9f82403a668d228dfd81c8df06821.zip |
Merge pull request #4009 from baude/execrmsocket
clean up after healthcheck execs
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index ac565fdad..0b5a8b946 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -163,7 +163,15 @@ func (c *Container) createExecBundle(sessionID string) (err error) { // cleanup an exec session after its done func (c *Container) cleanupExecBundle(sessionID string) error { - return os.RemoveAll(c.execBundlePath(sessionID)) + if err := os.RemoveAll(c.execBundlePath(sessionID)); err != nil && !os.IsNotExist(err) { + return err + } + // Clean up the sockets dir. Issue #3962 + // Also ignore if it doesn't exist for some reason; hence the conditional return below + if err := os.RemoveAll(filepath.Join(c.ociRuntime.socketsDir, sessionID)); err != nil && !os.IsNotExist(err) { + return err + } + return nil } // the path to a containers exec session bundle |