Skip to content

Commit 9bc0412

Browse files
hzhao-githubrjeberhard
authored andcommitted
Fixed failures of ItLBTwoDomainsNginx and ItLBTwoDomainsTraefik in internal OKE nightly
1 parent a06fc63 commit 9bc0412

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import oracle.weblogic.kubernetes.annotations.Namespaces;
2424
import oracle.weblogic.kubernetes.logging.LoggingFacade;
2525
import oracle.weblogic.kubernetes.utils.ExecCommand;
26+
import oracle.weblogic.kubernetes.utils.ExecResult;
2627
import org.junit.jupiter.api.AfterAll;
2728
import org.junit.jupiter.api.BeforeAll;
2829
import org.junit.jupiter.api.DisplayName;
@@ -38,6 +39,7 @@
3839
import static oracle.weblogic.kubernetes.TestConstants.ITLBTWODOMAINSNGINX_INGRESS_HTTP_NODEPORT;
3940
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
4041
import static oracle.weblogic.kubernetes.TestConstants.KIND_CLUSTER;
42+
import static oracle.weblogic.kubernetes.TestConstants.KUBERNETES_CLI;
4143
import static oracle.weblogic.kubernetes.TestConstants.NGINX_CHART_VERSION;
4244
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
4345
import static oracle.weblogic.kubernetes.TestConstants.SKIP_CLEANUP;
@@ -145,6 +147,16 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
145147
// install Nginx ingress controller for all test cases using Nginx
146148
installNginxIngressController();
147149

150+
String command = KUBERNETES_CLI + " get all --all-namespaces";
151+
logger.info("curl command to get all --all-namespaces is: {0}", command);
152+
153+
try {
154+
ExecResult result = ExecCommand.exec(command, true);
155+
logger.info("result is: {0}", result.toString());
156+
} catch (java.io.IOException | InterruptedException ex) {
157+
ex.printStackTrace();
158+
}
159+
148160
String ingressServiceName = nginxHelmParams.getHelmParams().getReleaseName() + "-ingress-nginx-controller";
149161
ingressIP = getServiceExtIPAddrtOke(ingressServiceName, nginxNamespace) != null
150162
? getServiceExtIPAddrtOke(ingressServiceName, nginxNamespace) : formatIPv6Host(K8S_NODEPORT_HOST);
@@ -510,10 +522,15 @@ private static void installNginxIngressController() {
510522
}
511523

512524
private static NginxParams installNginxLB() {
513-
514525
getLogger().info("Installing NGINX in namespace {0}", nginxNamespace);
526+
527+
String nodePortValue = null;
528+
if (!OKE_CLUSTER) {
529+
nodePortValue = "NodePort";
530+
}
531+
515532
NginxParams params = installAndVerifyNginx(nginxNamespace, ITLBTWODOMAINSNGINX_INGRESS_HTTP_NODEPORT,
516-
ITLBTWODOMAINSNGINX_INGRESS_HTTPS_NODEPORT, NGINX_CHART_VERSION, "NodePort");
533+
ITLBTWODOMAINSNGINX_INGRESS_HTTPS_NODEPORT, NGINX_CHART_VERSION, nodePortValue);
517534

518535
return params;
519536
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonLBTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public static void verifyAdminServerAccess(boolean isTLS,
837837
String pathLocation,
838838
String hostName) {
839839
StringBuffer readyAppUrl = new StringBuffer();
840-
String hostAndPort = getHostAndPort(hostName, lbNodePort);
840+
String hostAndPort = OKE_CLUSTER_PRIVATEIP ? hostName : getHostAndPort(hostName, lbNodePort);
841841

842842
if (isTLS) {
843843
readyAppUrl.append("https://");

0 commit comments

Comments
 (0)