summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-22 18:45:48 -0400
committerGitHub <noreply@github.com>2021-09-22 18:45:48 -0400
commit626df0a54e5dc2e11e287586c9e10c52e0dffe96 (patch)
treeff93eb3cae99704ef968309d94d67d08e3e5b146
parentf342784ce58fef0e79c61181e355f320d6f903da (diff)
parentb6fecbb75ed044bd93203f81929cdc9af6441dfd (diff)
downloadpodman-626df0a54e5dc2e11e287586c9e10c52e0dffe96.tar.gz
podman-626df0a54e5dc2e11e287586c9e10c52e0dffe96.tar.bz2
podman-626df0a54e5dc2e11e287586c9e10c52e0dffe96.zip
Merge pull request #11604 from rhatdan/deleteContainer
Ignore mount errors except ErrContainerUnknown when cleaningup container
-rw-r--r--libpod/runtime_cstorage.go6
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 {