summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-07-27 16:11:47 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-28 01:40:28 +0000
commit87d8edb4c10e53e6e9833ff8b64c3c0041f1823b (patch)
treecc0f7c1b71844e97f13e7003b6d2d4c5d6a9652a /libpod/image/image.go
parentbd7566f170d6c6f595a4e1376cabb83a62479584 (diff)
downloadpodman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.tar.gz
podman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.tar.bz2
podman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.zip
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
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go2
1 files changed, 1 insertions, 1 deletions
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()