Skip to content

Commit

Permalink
When using additional stores, report id only once
Browse files Browse the repository at this point in the history
Currently if you setup additional stores and pull the same
image that exists in additionalstore, podman ends up reporting
the ID twice.

Fixes: containers/podman#18647

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed May 26, 2023
1 parent fae9740 commit 5ee4b22
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5ee4b22

Please sign in to comment.