74
74
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .createTestWebAppWarFile ;
75
75
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .formatIPv6Host ;
76
76
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getHostAndPort ;
77
+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getServiceExtIPAddrtOke ;
77
78
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
78
79
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .runClientInsidePod ;
79
80
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .runJavacInsidePod ;
@@ -139,6 +140,9 @@ class ItIstioDBOperator {
139
140
private static String hostHeader ;
140
141
Map <String , String > httpHeaders ;
141
142
143
+ private static final String istioNamespace = "istio-system" ;
144
+ private static final String istioIngressServiceName = "istio-ingressgateway" ;
145
+
142
146
/**
143
147
* Start DB service and create RCU schema.
144
148
* Assigns unique namespaces for operator and domains.
@@ -418,7 +422,11 @@ private void runJmsClientOnAdminPod(String action, String queue) {
418
422
* @returns true if MBean is found otherwise false
419
423
**/
420
424
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
+
422
430
if (!TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
423
431
hostAndPort = formatIPv6Host (InetAddress .getLocalHost ().getHostAddress ()) + ":" + ISTIO_HTTP_HOSTPORT ;
424
432
}
@@ -437,7 +445,10 @@ private boolean checkJmsServerRuntime(String jmsServer, String managedServer) th
437
445
* @returns true if MBean is found otherwise false
438
446
**/
439
447
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
+
441
452
if (!TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
442
453
hostAndPort = formatIPv6Host (InetAddress .getLocalHost ().getHostAddress ()) + ":" + ISTIO_HTTP_HOSTPORT ;
443
454
}
@@ -458,9 +469,13 @@ private boolean checkStoreRuntime(String storeName, String managedServer) throws
458
469
* @returns true if MBean is found otherwise false
459
470
**/
460
471
private boolean checkJtaRecoveryServiceRuntime (String managedServer ,
461
- String recoveryService , String active ) throws UnknownHostException {
462
-
463
- String hostAndPort = getHostAndPort (adminSvcExtRouteHost , wlDomainIstioIngressPort );
472
+ String recoveryService ,
473
+ String active ) throws UnknownHostException {
474
+
475
+ String hostAndPort = getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace ) != null
476
+ ? getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace )
477
+ : getHostAndPort (adminSvcExtRouteHost , wlDomainIstioIngressPort );
478
+
464
479
if (!TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
465
480
hostAndPort = formatIPv6Host (InetAddress .getLocalHost ().getHostAddress ()) + ":" + ISTIO_HTTP_HOSTPORT ;
466
481
}
0 commit comments