Skip to content

Commit

Permalink
Merge pull request #1477 from rhatdan/pull
Browse files Browse the repository at this point in the history
When using additional stores, report id only once
  • Loading branch information
openshift-merge-robot authored Jun 13, 2023
2 parents 12cf968 + 9e7b16f commit e1ea4d9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,17 @@ 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))

// If you have additionStores defined and the same image stored in
// both storage and additional store, it can be output twice.
// Fixes github.com/containers/podman/issues/18647
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 e1ea4d9

Please sign in to comment.