diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-09-16 06:13:21 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-09-29 16:39:29 -0400 |
commit | 57c055f61a96fa49f8a8709297da5e81597e4b48 (patch) | |
tree | dd875db65362e57d7d442e15a4762aa2ef082b0d /libpod | |
parent | 8084c5ef241a7ced101454bc497d40f80e6ad840 (diff) | |
download | podman-57c055f61a96fa49f8a8709297da5e81597e4b48.tar.gz podman-57c055f61a96fa49f8a8709297da5e81597e4b48.tar.bz2 podman-57c055f61a96fa49f8a8709297da5e81597e4b48.zip |
Ignore mount errors except ErrContainerUnknown when cleaningup container
Fixes: https://github.com/containers/podman/issues/11207
[NO TESTS NEEDED] Since I don't know how to get into this situation.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_cstorage.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/runtime_cstorage.go b/libpod/runtime_cstorage.go index cd2f226af..58bd67e6d 100644 --- a/libpod/runtime_cstorage.go +++ b/libpod/runtime_cstorage.go @@ -106,18 +106,18 @@ func (r *Runtime) removeStorageContainer(idOrName string, force bool) error { logrus.Infof("Storage for container %s already removed", ctr.ID) return nil } - return errors.Wrapf(err, "error looking up container %q mounts", idOrName) + logrus.Warnf("Checking if container %q is mounted, attempting to delete: %v", idOrName, err) } if timesMounted > 0 { return errors.Wrapf(define.ErrCtrStateInvalid, "container %q is mounted and cannot be removed without using force", idOrName) } } else if _, err := r.store.Unmount(ctr.ID, true); err != nil { - if errors.Cause(err) == storage.ErrContainerUnknown { + if errors.Is(err, storage.ErrContainerUnknown) { // Container again gone, no error logrus.Infof("Storage for container %s already removed", ctr.ID) return nil } - return errors.Wrapf(err, "error unmounting container %q", idOrName) + logrus.Warnf("Unmounting container %q while attempting to delete storage: %v", idOrName, err) } if err := r.store.DeleteContainer(ctr.ID); err != nil { |