diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-09-29 10:03:46 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-09-29 10:12:49 -0400 |
commit | c9ea2cae1e1d48931c0dc3399e1114a66635840f (patch) | |
tree | db1730bb44c11b3760072e7a73976ff32f206dda /libpod/storage.go | |
parent | 453c49c488dd6518b33393e04c04ebc32ce61ee9 (diff) | |
download | podman-c9ea2cae1e1d48931c0dc3399e1114a66635840f.tar.gz podman-c9ea2cae1e1d48931c0dc3399e1114a66635840f.tar.bz2 podman-c9ea2cae1e1d48931c0dc3399e1114a66635840f.zip |
Storage can remove ErrNotAContainer as well
Fixes: https://github.com/containers/podman/issues/11775
[NO TESTS NEEDED] No easy way to cause this problem in CI.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/storage.go')
-rw-r--r-- | libpod/storage.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libpod/storage.go b/libpod/storage.go index ad78fe191..5c265df40 100644 --- a/libpod/storage.go +++ b/libpod/storage.go @@ -184,8 +184,12 @@ func (r *storageService) DeleteContainer(idOrName string) error { } err = r.store.DeleteContainer(container.ID) if err != nil { - logrus.Debugf("Failed to delete container %q: %v", container.ID, err) - return err + if errors.Cause(err) == storage.ErrNotAContainer || errors.Cause(err) == storage.ErrContainerUnknown { + logrus.Infof("Storage for container %s already removed", container.ID) + } else { + logrus.Debugf("Failed to delete container %q: %v", container.ID, err) + return err + } } return nil } |