diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-12-13 10:19:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-13 10:19:31 +0100 |
commit | 71a0c0f69c992a1840a28201526b211f9055b1b6 (patch) | |
tree | 142891c07239f655b3b6657e690d7736731601c9 /libpod/container_api.go | |
parent | 123e7ea5686a80d6b92486fa88284cfad7b1be6c (diff) | |
parent | bd44fd5c815fc750fd6b60899328564bee74e6e5 (diff) | |
download | podman-71a0c0f69c992a1840a28201526b211f9055b1b6.tar.gz podman-71a0c0f69c992a1840a28201526b211f9055b1b6.tar.bz2 podman-71a0c0f69c992a1840a28201526b211f9055b1b6.zip |
Merge pull request #4692 from mheon/reap_exec_sessions
Reap exec sessions on cleanup and removal
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 153a1d628..5168dbc68 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -594,7 +594,12 @@ func (c *Container) Cleanup(ctx context.Context) error { // If we didn't restart, we perform a normal cleanup - // Check if we have active exec sessions + // Reap exec sessions first. + if err := c.reapExecSessions(); err != nil { + return err + } + + // Check if we have active exec sessions after reaping. if len(c.state.ExecSessions) != 0 { return errors.Wrapf(define.ErrCtrStateInvalid, "container %s has active exec sessions, refusing to clean up", c.ID()) } |