aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-01-12 08:19:13 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-01-14 07:37:55 -0500
commit14940a067d007af445560a0a7eb414f6547a7cd4 (patch)
tree132d47f6b019e38a32951c2d9b38968b601c0169 /pkg/domain/infra
parent9686216f9d44e1d6b4fa60a5c0866746d1afa60b (diff)
downloadpodman-14940a067d007af445560a0a7eb414f6547a7cd4.tar.gz
podman-14940a067d007af445560a0a7eb414f6547a7cd4.tar.bz2
podman-14940a067d007af445560a0a7eb414f6547a7cd4.zip
Remove two GetImages functions from API
[NO NEW TESTS NEEDED] This is just code cleanup. The remote API has three different GetImages functions, which I believe can be handled by just one function. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/images_list.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/domain/infra/abi/images_list.go b/pkg/domain/infra/abi/images_list.go
index 2ec4ad244..47b47b065 100644
--- a/pkg/domain/infra/abi/images_list.go
+++ b/pkg/domain/infra/abi/images_list.go
@@ -26,9 +26,9 @@ func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions)
summaries := []*entities.ImageSummary{}
for _, img := range images {
- digests := make([]string, len(img.Digests()))
- for j, d := range img.Digests() {
- digests[j] = string(d)
+ repoDigests, err := img.RepoDigests()
+ if err != nil {
+ return nil, errors.Wrapf(err, "getting repoDigests from image %q", img.ID())
}
isDangling, err := img.IsDangling(ctx)
if err != nil {
@@ -37,11 +37,12 @@ func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions)
e := entities.ImageSummary{
ID: img.ID(),
- // ConfigDigest: string(img.ConfigDigest),
+ // TODO: libpod/image didn't set it but libimage should
+ // ConfigDigest: string(img.ConfigDigest),
Created: img.Created().Unix(),
Dangling: isDangling,
Digest: string(img.Digest()),
- RepoDigests: digests,
+ RepoDigests: repoDigests,
History: img.NamesHistory(),
Names: img.Names(),
ReadOnly: img.IsReadOnly(),