Skip to content

Commit

Permalink
Do not fail on duplicated local image tags. Fixes #2431 (#2692)
Browse files Browse the repository at this point in the history
* #2431 Correction for an edge case in local image repos (duplicates repo tags) crashing the image pulling

* Indentation correction

* Indentation correction
  • Loading branch information
Choobz committed May 13, 2020
1 parent e6930d6 commit 123f13a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ private void populateFromList(List<Image> images) {
}

cache.putAll(
Stream.of(repoTags).collect(Collectors.toMap(
DockerImageName::new,
it -> ImageData.from(image)
))
Stream.of(repoTags)
// Protection against some edge case where local image repository tags end up with duplicates
// making toMap crash at merge time.
.distinct()
.collect(Collectors.toMap(
DockerImageName::new,
it -> ImageData.from(image)
))
);
}
}
Expand Down

0 comments on commit 123f13a

Please sign in to comment.