mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
podman rmi shouldn't delete named referenced images
If an image is created from another and it is deleted, only delete the actual image and not the parent images if the parent images have names/references. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #1174 Approved by: mheon
This commit is contained in:
@ -363,7 +363,7 @@ func (i *Image) Remove(force bool) error {
|
||||
}
|
||||
// Do not remove if image is a base image and is not untagged, or if
|
||||
// the image has more children.
|
||||
if (nextParent == nil && len(parent.Names()) > 0) || len(children) > 0 {
|
||||
if len(children) > 0 || len(parent.Names()) > 0 {
|
||||
return nil
|
||||
}
|
||||
id := parent.ID()
|
||||
|
Reference in New Issue
Block a user