Skip to content

Commit 091c02b

Browse files
authored
replace warning IMG-0099 with simpler info message to avoid user confusion with patch versioning (#346)
1 parent 6b08a43 commit 091c02b

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruPatch.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,36 +254,33 @@ public static AruPatch selectPatch(List<AruPatch> patches, String providedVersio
254254
} else if (providedVersion != null && !selected.version().equals(providedVersion)) {
255255
throw new VersionNotFoundException(selected.patchId(), providedVersion, patches);
256256
} else {
257-
// the patch has a version from ARU, warn the user if the version doesn't match the target install
258-
if (psuVersion != null) {
259-
if (!selected.version().equals(psuVersion)) {
260-
logger.warning("IMG-0099", selected.patchId(), selected.version(), psuVersion);
261-
}
262-
} else {
263-
if (installerVersion != null && !selected.version().equals(installerVersion)) {
264-
logger.warning("IMG-0099", selected.patchId(), selected.version(), installerVersion);
265-
}
266-
}
257+
logger.info("IMG-0099", selected.patchId(), selected.version(), selected.description());
267258
}
259+
268260
logger.exiting(selected);
269261
return selected;
270262
}
271263

272264
Map<String, AruPatch> patchMap = patches.stream().collect(Collectors
273265
.toMap(AruPatch::version, aruPatch -> aruPatch));
274-
// if the user provided a specific version, select the provided version, or fail
266+
// select the correct patch version (priority order: user provided version, PSU version, GA installer version)
275267
if (providedVersion != null) {
268+
// if the user provided a specific version, select the provided version, or fail
276269
if (patchMap.containsKey(providedVersion)) {
277270
selected = patchMap.get(providedVersion);
278271
} else {
279272
throw new VersionNotFoundException(patches.get(0).patchId(), providedVersion, patches);
280273
}
281274
} else if (patchMap.containsKey(psuVersion)) {
275+
// if the image has a PSU installed, or the new patch list has a PSU, otherwise skip to installer version
282276
selected = patchMap.get(psuVersion);
283277
} else if (patchMap.containsKey(installerVersion)) {
284278
selected = patchMap.get(installerVersion);
285279
}
286280

281+
if (selected != null) {
282+
logger.info("IMG-0099", selected.patchId(), selected.version(), selected.description());
283+
}
287284
logger.exiting(selected);
288285
return selected;
289286
}

imagetool/src/main/resources/ImageTool.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ IMG-0095=Unable to parse response for Oracle patches in fromImage: {0}
9797
IMG-0096=Unable to patch image {0}. The installed products could not be identified for patching. The most likely cause is that the registry.xml in this image may be invalid.
9898
IMG-0097=Inspecting {0}, this may take a few minutes if the image is not available locally.
9999
IMG-0098=Patch [[red: {0}]] is a Stack Patch Bundle, not a patch. Remove {0} from --patches and use [[cyan: --recommendedPatches]] instead.
100-
IMG-0099=Patch [[red: {0}]] is only for version {1} and may not be applicable to the target version {2}. Check Oracle Support, there may be another patch number for version {2}. Or check the OPatch output for results for this image.
100+
IMG-0099=Found patch [[cyan: {0}]] for version [[cyan: {1}]]. Bug description: "{2}"
101101
IMG-0100=Missing argument --fromImage. Update requires an image to be updated. Use --fromImage to specify the image to build on.
102102
IMG-0101=The version of OPatch that you requested is not available: {0}
103103
IMG-0102=WDT {0} file [[brightred: {1}]] could not be found.

0 commit comments

Comments
 (0)