Skip to content

Commit 11c6bd9

Browse files
sankarpnrjeberhard
authored andcommitted
Fix for ingress update failure
1 parent 4a74e58 commit 11c6bd9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ private DomainResource createDomainResourceWithConfigMap(String domainUid, Strin
15701570
}
15711571

15721572
private void updateIngressBackendServicePort(int newAdminPort) throws ApiException {
1573-
String ingressName = introDomainNamespace + "-" + domainUid + "-" + adminServerName;
1573+
String ingressName = introDomainNamespace + "-" + domainUid + "-" + adminServerName + "-7001";
15741574
V1Ingress ingress = Ingress.getIngress(introDomainNamespace, ingressName).orElse(null);
15751575
if (ingress != null) {
15761576
logger.info("Updating ingress {0} with new admin port {1}", ingressName, newAdminPort);
@@ -1579,7 +1579,7 @@ private void updateIngressBackendServicePort(int newAdminPort) throws ApiExcepti
15791579
.setPort(new V1ServiceBackendPort().number(newAdminPort));
15801580
updateIngress(introDomainNamespace, ingress);
15811581
} else {
1582-
fail("Failed to update ingress");
1582+
fail("Ingress is null, failed to update ingress");
15831583
}
15841584
}
15851585

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/Ingress.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import static oracle.weblogic.kubernetes.actions.ActionConstants.INGRESS_API_VERSION;
2727
import static oracle.weblogic.kubernetes.actions.ActionConstants.INGRESS_KIND;
28+
import static oracle.weblogic.kubernetes.actions.impl.primitive.Kubernetes.listNamespacedIngresses;
2829
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
2930

3031
/**
@@ -240,11 +241,7 @@ public static List<String> listIngresses(String namespace) throws ApiException {
240241
* @throws ApiException if Kubernetes client API call fails
241242
*/
242243
public static Optional<V1Ingress> getIngress(String namespace, String ingressName) throws ApiException {
243-
244-
V1IngressList ingressList = Kubernetes.listNamespacedIngresses(namespace);
245-
List<V1Ingress> listOfIngress = ingressList.getItems();
246-
247-
return listOfIngress.stream().filter(
244+
return listNamespacedIngresses(namespace).getItems().stream().filter(
248245
ingress -> ingress.getMetadata().getName().equals(ingressName)).findAny();
249246
}
250247

0 commit comments

Comments
 (0)