Skip to content

Commit

Permalink
fix(core): Refine docker imageName selection when project is snapshot.
Browse files Browse the repository at this point in the history
…Fix #952
  • Loading branch information
aalmiray committed Oct 27, 2022
1 parent 313ec3f commit 241a8df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -67,9 +67,7 @@ protected <T> Set<T> merge(Set<T> existing, Set<T> incoming) {
Set<T> s1 = new LinkedHashSet<>();
if (null != existing) s1.addAll(existing);
if (null != incoming && !incoming.isEmpty()) {
Set<T> s2 = new LinkedHashSet<>(incoming);
s2.removeAll(s1);
s1.addAll(s2);
s1.addAll(incoming);
}

return s1;
Expand Down
Expand Up @@ -127,7 +127,8 @@ public static void validateDocker(JReleaserContext context, Distribution distrib
Optional<String> imageName = packager.getImageNames().stream()
.filter(n -> n.endsWith(":{{tagName}}") || n.endsWith(":{{ tagName }}"))
.findFirst();
packager.setImageNames(singleton(imageName.orElse("{{repoOwner}}/{{distributionName}}:{{tagName}}")));
// use the first finding or the first imageName
packager.setImageNames(singleton(imageName.orElse(packager.getImageNames().iterator().next())));
}

validateCommands(packager, parentPackager);
Expand Down

0 comments on commit 241a8df

Please sign in to comment.