Skip to content

Commit 55de432

Browse files
committed
Merge branch 'istio-db' into 'release/4.2'
OWLS-121702 - [wko-nightly] ItIstioDBOperator tests are failing on release/4.2 OKE nightly See merge request weblogic-cloud/weblogic-kubernetes-operator!4828
2 parents df44a5e + e2f98c7 commit 55de432

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDBOperator.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createTestWebAppWarFile;
7575
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.formatIPv6Host;
7676
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
77+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getServiceExtIPAddrtOke;
7778
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
7879
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.runClientInsidePod;
7980
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.runJavacInsidePod;
@@ -139,6 +140,9 @@ class ItIstioDBOperator {
139140
private static String hostHeader;
140141
Map<String, String> httpHeaders;
141142

143+
private static final String istioNamespace = "istio-system";
144+
private static final String istioIngressServiceName = "istio-ingressgateway";
145+
142146
/**
143147
* Start DB service and create RCU schema.
144148
* Assigns unique namespaces for operator and domains.
@@ -418,7 +422,11 @@ private void runJmsClientOnAdminPod(String action, String queue) {
418422
* @returns true if MBean is found otherwise false
419423
**/
420424
private boolean checkJmsServerRuntime(String jmsServer, String managedServer) throws UnknownHostException {
421-
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
425+
// In internal OKE env, use Istio EXTERNAL-IP; in non-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
426+
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
427+
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace)
428+
: getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
429+
422430
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
423431
hostAndPort = formatIPv6Host(InetAddress.getLocalHost().getHostAddress()) + ":" + ISTIO_HTTP_HOSTPORT;
424432
}
@@ -437,7 +445,10 @@ private boolean checkJmsServerRuntime(String jmsServer, String managedServer) th
437445
* @returns true if MBean is found otherwise false
438446
**/
439447
private boolean checkStoreRuntime(String storeName, String managedServer) throws UnknownHostException {
440-
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
448+
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
449+
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace)
450+
: getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
451+
441452
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
442453
hostAndPort = formatIPv6Host(InetAddress.getLocalHost().getHostAddress()) + ":" + ISTIO_HTTP_HOSTPORT;
443454
}
@@ -458,9 +469,13 @@ private boolean checkStoreRuntime(String storeName, String managedServer) throws
458469
* @returns true if MBean is found otherwise false
459470
**/
460471
private boolean checkJtaRecoveryServiceRuntime(String managedServer,
461-
String recoveryService, String active) throws UnknownHostException {
472+
String recoveryService,
473+
String active) throws UnknownHostException {
462474

463-
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
475+
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
476+
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace)
477+
: getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
478+
464479
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
465480
hostAndPort = formatIPv6Host(InetAddress.getLocalHost().getHostAddress()) + ":" + ISTIO_HTTP_HOSTPORT;
466481
}

0 commit comments

Comments
 (0)