Skip to content

Commit 5632965

Browse files
authored
Allow UPDATE to process fromImage with some unknown ARU products (#301)
1 parent d0a539f commit 5632965

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
package com.oracle.weblogic.imagetool.aru;
55

6+
import java.util.Arrays;
7+
68
/**
79
* ARU product codes for patching.
810
*/
@@ -52,4 +54,8 @@ public static AruProduct fromProductId(String value) {
5254
}
5355
throw new IllegalArgumentException("Invalid ARU data found in patch product ID: " + value);
5456
}
57+
58+
public static boolean isKnownAruProduct(String value) {
59+
return Arrays.stream(values()).anyMatch(p -> p.toString().equals(value));
60+
}
5561
}

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/FmwInstallerType.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ public static FmwInstallerType fromProductList(String products) {
137137

138138
// create a set from the comma-separated list
139139
Set<AruProduct> productSet = Stream.of(products.split(","))
140-
.filter(e -> !"TOPLINK".equals(e)) // skip TOPLINK product (WLS always contains TOPLINK)
141-
.filter(e -> !"BPM".equals(e)) // skip BPM product (SOA always contains BPM)
142140
.map(e -> "INFRA".equals(e) ? "JRF" : e) // map -> replaces any occurrence of INFRA with JRF
141+
.filter(AruProduct::isKnownAruProduct) // drop any products that cannot be patched individually (or unknown)
143142
.map(AruProduct::valueOf) // convert String to AruProduct enum
144143
.collect(Collectors.toSet());
145144

imagetool/src/test/java/com/oracle/weblogic/imagetool/installer/InstallerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ void fromProductList() {
5959
assertEquals(FmwInstallerType.WLS, FmwInstallerType.fromProductList("WLS,COH,TOPLINK"));
6060
assertEquals(FmwInstallerType.FMW, FmwInstallerType.fromProductList("INFRA,WLS,COH,TOPLINK"));
6161
assertEquals(FmwInstallerType.SOA_OSB, FmwInstallerType.fromProductList("INFRA,WLS,COH,TOPLINK,BPM,SOA,OSB"));
62+
// Ignore unsupported products, but keep as many products as possible that ARE known
63+
assertEquals(FmwInstallerType.FMW, FmwInstallerType.fromProductList("INFRA,WLS,COH,TOPLINK,OIM"));
6264
assertNull(FmwInstallerType.fromProductList(""));
6365
assertNull(FmwInstallerType.fromProductList(null));
6466
}

0 commit comments

Comments
 (0)