summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-12 23:23:08 +0200
committerGitHub <noreply@github.com>2019-09-12 23:23:08 +0200
commit20772182e6a9f82403a668d228dfd81c8df06821 (patch)
tree7de05b12842107ac333447a06864be266b218147 /libpod/container_internal.go
parent1ddfc11764a18815fea3a2d91ce8314c87d8e0b7 (diff)
parent7b68cd0b3d45c3d7e01b6134abaa0ece44518625 (diff)
downloadpodman-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/container_internal.go')
-rw-r--r--libpod/container_internal.go10
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