From 165c36f9ff4d759a7740bd813c1107a1e57bd708 Mon Sep 17 00:00:00 2001 From: Pedro Ruivo Date: Mon, 10 Jul 2023 16:02:55 +0100 Subject: [PATCH] Enable publishNotReadyAddresses for discovery service (#21511) Closes #21493 --- .../keycloak/operator/controllers/KeycloakDiscoveryService.java | 1 + .../operator/testsuite/integration/KeycloakServicesTest.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDiscoveryService.java b/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDiscoveryService.java index f18bb5453c..dc06ff4b58 100644 --- a/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDiscoveryService.java +++ b/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDiscoveryService.java @@ -45,6 +45,7 @@ public class KeycloakDiscoveryService extends OperatorManagedResource implements .endPort() .withSelector(getInstanceLabels()) .withClusterIP("None") + .withPublishNotReadyAddresses(Boolean.TRUE) .build(); } diff --git a/operator/src/test/java/org/keycloak/operator/testsuite/integration/KeycloakServicesTest.java b/operator/src/test/java/org/keycloak/operator/testsuite/integration/KeycloakServicesTest.java index 02de03eb0b..120a9194d0 100644 --- a/operator/src/test/java/org/keycloak/operator/testsuite/integration/KeycloakServicesTest.java +++ b/operator/src/test/java/org/keycloak/operator/testsuite/integration/KeycloakServicesTest.java @@ -100,6 +100,8 @@ public class KeycloakServicesTest extends BaseOperatorTest { Log.info("Trying to modify the service"); var currentDiscoveryService = discoveryServiceSelector.get(); + // check publishNotReadyAddresses is set + assertThat(currentDiscoveryService.getSpec().getPublishNotReadyAddresses()).isTrue(); var labels = Map.of("address", "EvergreenTerrace742"); // ignoring current IP/s currentDiscoveryService.getSpec().setClusterIP(null);