From 14940a067d007af445560a0a7eb414f6547a7cd4 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 12 Jan 2022 08:19:13 -0500 Subject: 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 --- pkg/domain/infra/abi/images_list.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pkg/domain/infra') 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(), -- cgit v1.2.3-54-g00ecf