Skip to content

Commit e84a049

Browse files
committed
Merge branch 'patching-irregularities' into 'main'
Remove DB19 client installer recommendation from recommended patch list, and include JRF patches in OHS recommendations. See merge request weblogic-cloud/weblogic-image-tool!492
2 parents 456734c + 17b074e commit e84a049

File tree

5 files changed

+45
-3
lines changed

5 files changed

+45
-3
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,22 @@ public boolean isStackPatchBundle() {
166166
return description != null && description.contains("STACK PATCH BUNDLE");
167167
}
168168

169+
/**
170+
* Returns true if this patch is known irregular patch (not an actual patch).
171+
* <ol>
172+
* <li>Stack Patch Bundle is a zip of patches, but is not a patch itself.</li>
173+
* <li>DB Client 19c Upgrade (34761383) is an installer, and not a patch.</li>
174+
* </ol>
175+
* @return true if this patch is a StackPatchBundle or known installer, false otherwise.
176+
*/
177+
public boolean isIrregularPatch() {
178+
boolean result = "34761383".equals(patchId) || isStackPatchBundle();
179+
if (result) {
180+
logger.fine("Detected irregular patch {0}: {1}", patchId, description);
181+
}
182+
return result;
183+
}
184+
169185
public boolean isCoherenceFeaturePack() {
170186
return description != null && description.contains("Coherence 14.1.1 Feature Pack");
171187
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, Architecture arc
155155
return AruPatch.getPatches(aruRecommendations)
156156
.filter(p -> p.isApplicableToTarget(architecture.getAruPlatform()))
157157
.filter(AruPatch::isPsu)
158-
.filter(not(AruPatch::isStackPatchBundle))
158+
.filter(not(AruPatch::isIrregularPatch))
159159
.collect(Collectors.toList());
160160
} catch (NoPatchesFoundException ex) {
161161
logger.exiting();
@@ -273,7 +273,7 @@ List<AruPatch> getReleaseRecommendations(AruProduct product, String releaseNumbe
273273

274274
return AruPatch.getPatches(patchesDocument)
275275
.filter(p -> p.isApplicableToTarget(architecture.getAruPlatform()))
276-
.filter(not(AruPatch::isStackPatchBundle)) // remove the Stack Patch Bundle patch, if returned
276+
.filter(not(AruPatch::isIrregularPatch)) // remove the Stack Patch Bundle patch, if returned
277277
// TODO: Need an option for the user to request the Coherence additional feature pack.
278278
.filter(not(AruPatch::isCoherenceFeaturePack)) // remove the Coherence feature pack, if returned
279279
.filter(p -> p.release().equals(releaseNumber))

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonCreateOptions.java

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import com.oracle.weblogic.imagetool.api.model.CachedFile;
1313
import com.oracle.weblogic.imagetool.aru.AruException;
14+
import com.oracle.weblogic.imagetool.installer.FmwInstallerType;
1415
import com.oracle.weblogic.imagetool.installer.InstallerType;
1516
import com.oracle.weblogic.imagetool.installer.MiddlewareInstall;
1617
import com.oracle.weblogic.imagetool.logging.LoggingFacade;
@@ -44,6 +45,7 @@ void prepareNewImage() throws IOException, InterruptedException, XPathExpression
4445
installerResponseFiles, getTargetArchitecture());
4546
install.copyFiles(cache(), buildDir());
4647
dockerfileOptions.setMiddlewareInstall(install);
48+
dockerfileOptions.includeBinaryOsPackages(getInstallerType().equals(FmwInstallerType.OHS));
4749
} else {
4850
dockerfileOptions.setWdtBase("os_update");
4951
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public enum FmwInstallerType {
8181
WCS(Utils.toSet(FMW.products, AruProduct.WCS),
8282
InstallerType.FMW, InstallerType.WCS),
8383
OHS(Utils.toSet(AruProduct.OHS, AruProduct.OAM_WG, AruProduct.WLS, AruProduct.JDBC, AruProduct.FMWPLAT,
84-
AruProduct.OSS, AruProduct.FIT, AruProduct.FMW_GLCM),
84+
AruProduct.OSS, AruProduct.FIT, AruProduct.JRF, AruProduct.FMW_GLCM),
8585
InstallerType.OHS, InstallerType.DB19),
8686
ODI(Collections.singleton(AruProduct.ODI),
8787
InstallerType.ODI)

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/DockerfileOptions.java

+24
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class DockerfileOptions {
3939

4040
private static final List<String> DEFAULT_OS_PACKAGES = Arrays.asList(
4141
"gzip", "tar", "unzip", "libaio", "libnsl", "jq", "findutils", "diffutils");
42+
private static final List<String> BINARY_OS_PACKAGES = Arrays.asList("binutils", "make", "glibc-devel");
4243
private static final String WLSIMG_OS_PACKAGES = System.getenv("WLSIMG_OS_PACKAGES");
4344

4445
private static final String DEFAULT_ORAINV_DIR = "/u01/oracle/oraInventory";
@@ -72,6 +73,7 @@ public class DockerfileOptions {
7273
private MiddlewareInstall mwInstallers;
7374
private boolean useOwnerPermsForGroup;
7475
private boolean usingBusybox;
76+
private boolean includeBinaryOsPackages;
7577
private List<String> buildArgs;
7678

7779
// WDT values
@@ -104,6 +106,7 @@ public DockerfileOptions(String buildId) {
104106
skipMiddlewareInstall = false;
105107
useOwnerPermsForGroup = false;
106108
usingBusybox = false;
109+
includeBinaryOsPackages = false;
107110
buildArgs = new ArrayList<>();
108111

109112
javaHome = DEFAULT_JAVA_HOME;
@@ -1109,6 +1112,24 @@ public boolean useOwnerPermsForGroup() {
11091112
return useOwnerPermsForGroup;
11101113
}
11111114

1115+
/**
1116+
* Include OS packages for binary patching such as make for OPatch.
1117+
* @param value true if additional OS patches for binary patching should be added to the image.
1118+
* @return this
1119+
*/
1120+
public DockerfileOptions includeBinaryOsPackages(boolean value) {
1121+
includeBinaryOsPackages = value;
1122+
return this;
1123+
}
1124+
1125+
/**
1126+
* Returns true if additional OS patches for binary patching should be added to the image.
1127+
* @return true if additional OS patches for binary patching should be added to the image, false otherwise.
1128+
*/
1129+
public boolean includeBinaryOsPackages() {
1130+
return includeBinaryOsPackages;
1131+
}
1132+
11121133
/**
11131134
* Returns true if BusyBox options should be used in the Dockerfile.
11141135
*
@@ -1160,6 +1181,9 @@ public List<String> osPackages() {
11601181
if (Utils.isEmptyString(WLSIMG_OS_PACKAGES)) {
11611182
// If the user did not provide a list of OS packages, use the default list
11621183
result.addAll(DEFAULT_OS_PACKAGES);
1184+
if (includeBinaryOsPackages()) {
1185+
result.addAll(BINARY_OS_PACKAGES);
1186+
}
11631187
} else {
11641188
// When provided in the environment variable, use the list of OS packages provided by the user.
11651189
result.addAll(Stream.of(WLSIMG_OS_PACKAGES.split(" ")).collect(Collectors.toList()));

0 commit comments

Comments
 (0)