summaryrefslogtreecommitdiff
path: root/libpod/image/prune.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-08 07:14:37 -0400
committerGitHub <noreply@github.com>2020-08-08 07:14:37 -0400
commit3173a18f6f97ddb684230296054216b526a54f0e (patch)
treea75b3cb153d308097c97470aa0958929cab88c22 /libpod/image/prune.go
parent1298161ae47a77ba2666903a30ae080710b00f9c (diff)
parent8827100b98d0e8afa6cd7a8d7415cb748948a417 (diff)
downloadpodman-3173a18f6f97ddb684230296054216b526a54f0e.tar.gz
podman-3173a18f6f97ddb684230296054216b526a54f0e.tar.bz2
podman-3173a18f6f97ddb684230296054216b526a54f0e.zip
Merge pull request #7215 from vrothberg/flatten-the-curve
images: speed up lists
Diffstat (limited to 'libpod/image/prune.go')
-rw-r--r--libpod/image/prune.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/image/prune.go b/libpod/image/prune.go
index 8c9267650..5a9ca5d8e 100644
--- a/libpod/image/prune.go
+++ b/libpod/image/prune.go
@@ -66,6 +66,12 @@ func (ir *Runtime) GetPruneImages(ctx context.Context, all bool, filterFuncs []I
if err != nil {
return nil, err
}
+
+ tree, err := ir.layerTree()
+ if err != nil {
+ return nil, err
+ }
+
for _, i := range allImages {
// filter the images based on this.
for _, filterFunc := range filterFuncs {
@@ -85,8 +91,9 @@ func (ir *Runtime) GetPruneImages(ctx context.Context, all bool, filterFuncs []I
}
}
- //skip the cache or intermediate images
- intermediate, err := i.Intermediate(ctx)
+ // skip the cache (i.e., with parent) and intermediate (i.e.,
+ // with children) images
+ intermediate, err := tree.hasChildrenAndParent(ctx, i)
if err != nil {
return nil, err
}