|
23 | 23 | import io.kubernetes.client.custom.Quantity;
|
24 | 24 | import io.kubernetes.client.custom.V1Patch;
|
25 | 25 | import io.kubernetes.client.openapi.ApiException;
|
26 |
| -import io.kubernetes.client.openapi.models.V1Container; |
27 | 26 | import io.kubernetes.client.openapi.models.V1EnvVar;
|
28 | 27 | import io.kubernetes.client.openapi.models.V1Ingress;
|
29 | 28 | import io.kubernetes.client.openapi.models.V1LocalObjectReference;
|
|
121 | 120 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createIngressHostRouting;
|
122 | 121 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.formatIPv6Host;
|
123 | 122 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.generateNewModelFileWithUpdatedDomainUid;
|
| 123 | +import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getDateAndTimeStamp; |
124 | 124 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
|
125 | 125 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
|
126 | 126 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
|
|
129 | 129 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyServerCommunication;
|
130 | 130 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withStandardRetryPolicy;
|
131 | 131 | import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapAndVerify;
|
132 |
| -import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapForDomainCreation; |
133 | 132 | import static oracle.weblogic.kubernetes.utils.DeployUtil.deployUsingWlst;
|
134 | 133 | import static oracle.weblogic.kubernetes.utils.DomainUtils.checkDomainStatusConditionTypeExists;
|
135 | 134 | import static oracle.weblogic.kubernetes.utils.DomainUtils.checkDomainStatusConditionTypeHasExpectedStatus;
|
|
140 | 139 | import static oracle.weblogic.kubernetes.utils.ImageUtils.createMiiImageAndVerify;
|
141 | 140 | import static oracle.weblogic.kubernetes.utils.ImageUtils.createTestRepoSecret;
|
142 | 141 | import static oracle.weblogic.kubernetes.utils.ImageUtils.imageRepoLoginAndPushImageToRegistry;
|
143 |
| -import static oracle.weblogic.kubernetes.utils.JobUtils.createDomainJob; |
144 | 142 | import static oracle.weblogic.kubernetes.utils.JobUtils.getIntrospectJobName;
|
145 | 143 | import static oracle.weblogic.kubernetes.utils.K8sEvents.DOMAIN_ROLL_COMPLETED;
|
146 | 144 | import static oracle.weblogic.kubernetes.utils.K8sEvents.DOMAIN_ROLL_STARTING;
|
@@ -1152,18 +1150,19 @@ private static void createDomain() {
|
1152 | 1150 | File wlsModelPropFile = createWdtPropertyFile(wlsModelFilePrefix, K8S_NODEPORT_HOST, t3ChannelPort);
|
1153 | 1151 |
|
1154 | 1152 | // create domainCreationImage
|
1155 |
| - String domainCreationImageName = DOMAIN_IMAGES_PREFIX + "introspect-domain-on-pv-image"; |
| 1153 | + String domainCreationImageName = DOMAIN_IMAGES_PREFIX + "wls-domain-on-pv-image"; |
| 1154 | + String domainCreationImagetag = getDateAndTimeStamp(); |
1156 | 1155 | // create image with model and wdt installation files
|
1157 | 1156 | WitParams witParams
|
1158 | 1157 | = new WitParams()
|
1159 | 1158 | .modelImageName(domainCreationImageName)
|
1160 |
| - .modelImageTag(MII_BASIC_IMAGE_TAG) |
| 1159 | + .modelImageTag(domainCreationImagetag) |
1161 | 1160 | .modelFiles(Collections.singletonList(MODEL_DIR + "/" + wlsModelFile))
|
1162 | 1161 | .modelVariableFiles(Collections.singletonList(wlsModelPropFile.getAbsolutePath()));
|
1163 |
| - createAndPushAuxiliaryImage(domainCreationImageName, MII_BASIC_IMAGE_TAG, witParams); |
| 1162 | + createAndPushAuxiliaryImage(domainCreationImageName, domainCreationImagetag, witParams); |
1164 | 1163 |
|
1165 | 1164 | DomainCreationImage domainCreationImage
|
1166 |
| - = new DomainCreationImage().image(domainCreationImageName + ":" + MII_BASIC_IMAGE_TAG); |
| 1165 | + = new DomainCreationImage().image(domainCreationImageName + ":" + domainCreationImagetag); |
1167 | 1166 |
|
1168 | 1167 | // create a domain resource
|
1169 | 1168 | logger.info("Creating domain custom resource");
|
@@ -1194,7 +1193,8 @@ private static void createDomain() {
|
1194 | 1193 | uniqueDomainHome,
|
1195 | 1194 | cluster1ReplicaCount,
|
1196 | 1195 | t3ChannelPort,
|
1197 |
| - configuration); |
| 1196 | + configuration, |
| 1197 | + WEBLOGIC_IMAGE_TO_USE_IN_SPEC); |
1198 | 1198 |
|
1199 | 1199 | setPodAntiAffinity(domain);
|
1200 | 1200 | // verify the domain custom resource is created
|
@@ -1253,48 +1253,6 @@ private static void createDomain() {
|
1253 | 1253 | verifyMemberHealth(adminServerPodName, managedServerNames, wlsUserName, wlsPassword);
|
1254 | 1254 | }
|
1255 | 1255 |
|
1256 |
| - |
1257 |
| - /** |
1258 |
| - * Create a WebLogic domain on a persistent volume by doing the following. |
1259 |
| - * Create a configmap containing WLST script and property file. |
1260 |
| - * Create a Kubernetes job to create domain on persistent volume. |
1261 |
| - * |
1262 |
| - * @param wlstScriptFile python script to create domain |
1263 |
| - * @param domainPropertiesFile properties file containing domain configuration |
1264 |
| - * @param pvName name of the persistent volume to create domain in |
1265 |
| - * @param pvcName name of the persistent volume claim |
1266 |
| - * @param namespace name of the domain namespace in which the job is created |
1267 |
| - */ |
1268 |
| - private static void createDomainOnPVUsingWlst(Path wlstScriptFile, Path domainPropertiesFile, |
1269 |
| - String pvName, String pvcName, String namespace) { |
1270 |
| - logger.info("Preparing to run create domain job using WLST"); |
1271 |
| - |
1272 |
| - List<Path> domainScriptFiles = new ArrayList<>(); |
1273 |
| - domainScriptFiles.add(wlstScriptFile); |
1274 |
| - domainScriptFiles.add(domainPropertiesFile); |
1275 |
| - |
1276 |
| - logger.info("Creating a config map to hold domain creation scripts"); |
1277 |
| - String domainScriptConfigMapName = "create-domain-scripts-cm"; |
1278 |
| - assertDoesNotThrow( |
1279 |
| - () -> createConfigMapForDomainCreation( |
1280 |
| - domainScriptConfigMapName, domainScriptFiles, namespace, ItIntrospectVersion.class.getSimpleName()), |
1281 |
| - "Create configmap for domain creation failed"); |
1282 |
| - |
1283 |
| - // create a V1Container with specific scripts and properties for creating domain |
1284 |
| - V1Container jobCreationContainer = new V1Container() |
1285 |
| - .addCommandItem("/bin/sh") |
1286 |
| - .addArgsItem("/u01/oracle/oracle_common/common/bin/wlst.sh") |
1287 |
| - .addArgsItem("/u01/weblogic/" + wlstScriptFile.getFileName()) //wlst.sh script |
1288 |
| - .addArgsItem("-skipWLSModuleScanning") |
1289 |
| - .addArgsItem("-loadProperties") |
1290 |
| - .addArgsItem("/u01/weblogic/" + domainPropertiesFile.getFileName()); //domain property file |
1291 |
| - |
1292 |
| - logger.info("Running a Kubernetes job to create the domain"); |
1293 |
| - createDomainJob(WEBLOGIC_IMAGE_TO_USE_IN_SPEC, pvName, pvcName, domainScriptConfigMapName, |
1294 |
| - namespace, jobCreationContainer); |
1295 |
| - |
1296 |
| - } |
1297 |
| - |
1298 | 1256 | private static void verifyMemberHealth(String adminServerPodName, List<String> managedServerNames,
|
1299 | 1257 | String user, String code) {
|
1300 | 1258 |
|
|
0 commit comments