diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-23 14:53:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-23 14:53:26 -0500 |
commit | ca0af71befa7e8408d83c59511e289cb57cf3c6d (patch) | |
tree | 2823cf9123dbb8e082fcc83fc098d28cf63fe2a0 /libpod | |
parent | 4dfcd585243b1695d36ac2a1a90dcb9818773511 (diff) | |
parent | e5ac28f3b968661e5c2603880a5c4576d590f3dd (diff) | |
download | podman-ca0af71befa7e8408d83c59511e289cb57cf3c6d.tar.gz podman-ca0af71befa7e8408d83c59511e289cb57cf3c6d.tar.bz2 podman-ca0af71befa7e8408d83c59511e289cb57cf3c6d.zip |
Merge pull request #9485 from vrothberg/fix-9479
container removal: handle already removed containers
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_exec.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go index 7b1d797bb..8d63ef90f 100644 --- a/libpod/container_exec.go +++ b/libpod/container_exec.go @@ -954,18 +954,22 @@ func (c *Container) removeAllExecSessions() error { } // Delete all exec sessions if err := c.runtime.state.RemoveContainerExecSessions(c); err != nil { - if lastErr != nil { - logrus.Errorf("Error stopping container %s exec sessions: %v", c.ID(), lastErr) + if errors.Cause(err) != define.ErrCtrRemoved { + if lastErr != nil { + logrus.Errorf("Error stopping container %s exec sessions: %v", c.ID(), lastErr) + } + lastErr = err } - lastErr = err } c.state.ExecSessions = nil c.state.LegacyExecSessions = nil if err := c.save(); err != nil { - if lastErr != nil { - logrus.Errorf("Error stopping container %s exec sessions: %v", c.ID(), lastErr) + if errors.Cause(err) != define.ErrCtrRemoved { + if lastErr != nil { + logrus.Errorf("Error stopping container %s exec sessions: %v", c.ID(), lastErr) + } + lastErr = err } - lastErr = err } return lastErr |