7474import static oracle .weblogic .kubernetes .utils .CommonTestUtils .createTestWebAppWarFile ;
7575import static oracle .weblogic .kubernetes .utils .CommonTestUtils .formatIPv6Host ;
7676import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getHostAndPort ;
77+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getServiceExtIPAddrtOke ;
7778import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
7879import static oracle .weblogic .kubernetes .utils .CommonTestUtils .runClientInsidePod ;
7980import 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