ingress: set annotation for openshift routes

fixes #12182
This commit is contained in:
Tobias Florek 2022-06-07 12:01:28 +02:00 committed by Bruno Oliveira da Silva
parent a40acd413a
commit fa22f1bdc7
2 changed files with 3 additions and 1 deletions

View file

@ -67,6 +67,7 @@ public class KeycloakIngress extends OperatorManagedResource implements StatusUp
.withName(getName())
.withNamespace(getNamespace())
.addToAnnotations("nginx.ingress.kubernetes.io/backend-protocol", backendProtocol)
.addToAnnotations("route.openshift.io/termination", "passthrough")
.endMetadata()
.withNewSpec()
.withNewDefaultBackend()
@ -80,7 +81,7 @@ public class KeycloakIngress extends OperatorManagedResource implements StatusUp
.addNewRule()
.withNewHttp()
.addNewPath()
.withPath("/")
.withPath("")
.withPathType("ImplementationSpecific")
.withNewBackend()
.withNewService()

View file

@ -141,6 +141,7 @@ public class KeycloakIngressE2EIT extends ClusterOperatorTest {
var i = ingressSelector.get();
assertThat(i.getMetadata().getLabels().entrySet().containsAll(labels.entrySet())).isTrue(); // additional labels should not be overwritten
assertEquals("HTTPS", i.getMetadata().getAnnotations().get("nginx.ingress.kubernetes.io/backend-protocol"));
assertEquals("passthrough", i.getMetadata().getAnnotations().get("route.openshift.io/termination"));
assertEquals(Constants.KEYCLOAK_HTTPS_PORT, i.getSpec().getDefaultBackend().getService().getPort().getNumber());
});