diff options
author | Matthew Heon <mheon@redhat.com> | 2020-04-15 16:52:50 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-05-14 16:56:01 -0400 |
commit | c76cf1735c1c9ec36abdf76d6c72b3f758d3d341 (patch) | |
tree | ca94189148a8cbe40f9202893628a8c39b103fcb /libpod | |
parent | cf1f13af986b1e81bc17f58aae428610c14afc4f (diff) | |
download | podman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.tar.gz podman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.tar.bz2 podman-c76cf1735c1c9ec36abdf76d6c72b3f758d3d341.zip |
Don't fail when saving exec status fails on removed ctr
We can't save the exec session, but it's because the container
is entirely gone, so no point erroring.
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_exec.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go index 8ae9df1ae..979594eb4 100644 --- a/libpod/container_exec.go +++ b/libpod/container_exec.go @@ -922,6 +922,12 @@ func writeExecExitCode(c *Container, sessionID string, exitCode int) error { // If we can't do this, no point in continuing, any attempt to save // would write garbage to the DB. if err := c.syncContainer(); err != nil { + if errors.Cause(err) == define.ErrNoSuchCtr || errors.Cause(err) == define.ErrCtrRemoved { + // Container's entirely removed. We can't save status, + // but the container's entirely removed, so we don't + // need to. Exit without error. + return nil + } return errors.Wrapf(err, "error syncing container %s state to remove exec session %s", c.ID(), sessionID) } |