Skip to content

Commit

Permalink
Merge pull request containers#4009 from baude/execrmsocket
Browse files Browse the repository at this point in the history
clean up after healthcheck execs
  • Loading branch information
openshift-merge-robot authored Sep 12, 2019
2 parents 1ddfc11 + 7b68cd0 commit 2077218
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2077218

Please sign in to comment.