Skip to content

Commit 06c2b4d

Browse files
committed
Be more cautious when manipulating projectData in ToolsUtils
The map can actually contain both the new form and the old form in the case of new releases. We will have to dig further but we need a bandaid...
1 parent b7e1d01 commit 06c2b4d

File tree

1 file changed

+16
-14
lines changed
  • independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools

1 file changed

+16
-14
lines changed

independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,20 +240,22 @@ public static Map<String, Object> readProjectData(ExtensionCatalog catalog) {
240240
Map<String, Object> projectData = (Map<String, Object>) map.getOrDefault("codestart-data", Map.of());
241241

242242
// fix the dockerfile entries for Platform < 3.23.1
243-
projectData = projectData.entrySet().stream()
244-
.collect(Collectors.toMap(
245-
e -> {
246-
if (!e.getKey().startsWith("dockerfile.")) {
247-
return e.getKey();
248-
}
249-
String key = e.getKey();
250-
if ("dockerfile.native-micro".equals(key)) {
251-
key += ".from";
252-
}
253-
254-
return "tooling-dockerfiles." + key;
255-
},
256-
Entry::getValue));
243+
if (!projectData.containsKey("tooling-dockerfiles.dockerfile.jvm.from-template")) {
244+
projectData = projectData.entrySet().stream()
245+
.collect(Collectors.toMap(
246+
e -> {
247+
if (!e.getKey().startsWith("dockerfile.")) {
248+
return e.getKey();
249+
}
250+
String key = e.getKey();
251+
if ("dockerfile.native-micro".equals(key)) {
252+
key += ".from";
253+
}
254+
255+
return "tooling-dockerfiles." + key;
256+
},
257+
Entry::getValue, (v1, v2) -> v1));
258+
}
257259

258260
return projectData;
259261
}

0 commit comments

Comments
 (0)