summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/types.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-27 10:57:21 +0200
committerGitHub <noreply@github.com>2021-07-27 10:57:21 +0200
commitd7b2f03f8a5d0e3789ac185ea03989463168fb76 (patch)
tree3918f9d850ac3d7f8354872541bbd04af7862608 /pkg/api/handlers/types.go
parent4f5b19c5080543974c3498804b43d277271b2f33 (diff)
parent1b6423e9f172b6d2437011ef4504a8247728a73d (diff)
downloadpodman-d7b2f03f8a5d0e3789ac185ea03989463168fb76.tar.gz
podman-d7b2f03f8a5d0e3789ac185ea03989463168fb76.tar.bz2
podman-d7b2f03f8a5d0e3789ac185ea03989463168fb76.zip
Merge pull request #10983 from vrothberg/fix-dangling
refine dangling checks
Diffstat (limited to 'pkg/api/handlers/types.go')
-rw-r--r--pkg/api/handlers/types.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index 3cc10d70f..af5878798 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -176,6 +176,11 @@ func ImageToImageSummary(l *libimage.Image) (*entities.ImageSummary, error) {
}
containerCount := len(containers)
+ isDangling, err := l.IsDangling(context.TODO())
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to check if image %s is dangling", l.ID())
+ }
+
is := entities.ImageSummary{
ID: l.ID(),
ParentId: imageData.Parent,
@@ -188,7 +193,7 @@ func ImageToImageSummary(l *libimage.Image) (*entities.ImageSummary, error) {
Labels: imageData.Labels,
Containers: containerCount,
ReadOnly: l.IsReadOnly(),
- Dangling: l.IsDangling(),
+ Dangling: isDangling,
Names: l.Names(),
Digest: string(imageData.Digest),
ConfigDigest: "", // TODO: libpod/image didn't set it but libimage should