From 5ee4b2209e2e5d96f95d0449532f79b4f9a2b822 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 26 May 2023 09:59:05 -0400 Subject: [PATCH] When using additional stores, report id only once Currently if you setup additional stores and pull the same image that exists in additionalstore, podman ends up reporting the ID twice. Fixes: https://github.com/containers/podman/issues/18647 Signed-off-by: Daniel J Walsh --- libimage/pull.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libimage/pull.go b/libimage/pull.go index 4a0f5970d..b83570d74 100644 --- a/libimage/pull.go +++ b/libimage/pull.go @@ -442,8 +442,13 @@ func (r *Runtime) imagesIDsForManifest(manifestBytes []byte, sys *types.SystemCo if err != nil { return nil, fmt.Errorf("listing images by manifest digest: %w", err) } - results := make([]string, 0, len(images)) + results := []string{} + imageMap := map[string]bool{} for _, image := range images { + if imageMap[image.ID] { + continue + } + imageMap[image.ID] = true results = append(results, image.ID) } if len(results) == 0 {