mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Merge pull request #11787 from rhatdan/deleteContainer
Storage can remove ErrNotAContainer as well
This commit is contained in:
@ -121,7 +121,7 @@ func (r *Runtime) removeStorageContainer(idOrName string, force bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := r.store.DeleteContainer(ctr.ID); err != nil {
|
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
|
// Container again gone, no error
|
||||||
logrus.Infof("Storage for container %s already removed", ctr.ID)
|
logrus.Infof("Storage for container %s already removed", ctr.ID)
|
||||||
return nil
|
return nil
|
||||||
|
@ -184,8 +184,12 @@ func (r *storageService) DeleteContainer(idOrName string) error {
|
|||||||
}
|
}
|
||||||
err = r.store.DeleteContainer(container.ID)
|
err = r.store.DeleteContainer(container.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Debugf("Failed to delete container %q: %v", container.ID, err)
|
if errors.Cause(err) == storage.ErrNotAContainer || errors.Cause(err) == storage.ErrContainerUnknown {
|
||||||
return err
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user