mirror of
https://github.com/containers/podman.git
synced 2025-06-26 12:56:45 +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 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
|
||||
}
|
||||
|
Reference in New Issue
Block a user