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>
This commit is contained in:
parent
453c49c488
commit
c9ea2cae1e
|
|
@ -121,7 +121,7 @@ func (r *Runtime) removeStorageContainer(idOrName string, force bool) error {
|
|||
}
|
||||
|
||||
if err := r.store.DeleteContainer(ctr.ID); err != nil {
|
||||
if errors.Cause(err) == storage.ErrContainerUnknown {
|
||||
if errors.Cause(err) == storage.ErrNotAContainer || errors.Cause(err) == storage.ErrContainerUnknown {
|
||||
// Container again gone, no error
|
||||
logrus.Infof("Storage for container %s already removed", ctr.ID)
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue