From 87d8edb4c10e53e6e9833ff8b64c3c0041f1823b Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Fri, 27 Jul 2018 16:11:47 -0400 Subject: 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 Closes: #1174 Approved by: mheon --- libpod/image/image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/image') diff --git a/libpod/image/image.go b/libpod/image/image.go index 0e236503d..112eeb015 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -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() -- cgit v1.2.3-54-g00ecf