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);