Skip to content

Commit

Permalink
Merge pull request #46710 from jedla97/fix-kc-shared-network
Browse files Browse the repository at this point in the history
Fix the keycloak devservice when using shared network
  • Loading branch information
sberyozkin authored Mar 11, 2025
2 parents 99bdb00 + c6ee979 commit 8b51493
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ protected void configure() {
if (useSharedNetwork) {
hostName = ConfigureUtil.configureSharedNetwork(this, "keycloak");
if (keycloakX) {
addEnv(KEYCLOAK_QUARKUS_HOSTNAME, "http://" + hostName);
addEnv(KEYCLOAK_QUARKUS_HOSTNAME, "http://" + hostName + ":" + KEYCLOAK_PORT);
} else {
addEnv(KEYCLOAK_WILDFLY_FRONTEND_URL, "http://localhost:" + fixedExposedPort.getAsInt());
}
Expand Down Expand Up @@ -557,8 +557,7 @@ protected void configure() {
if (keycloakX) {
addEnv(KEYCLOAK_QUARKUS_ADMIN_PROP, KEYCLOAK_ADMIN_USER);
addEnv(KEYCLOAK_QUARKUS_ADMIN_PASSWORD_PROP, KEYCLOAK_ADMIN_PASSWORD);
String finalStartCommand = startCommand.orElse(KEYCLOAK_QUARKUS_START_CMD)
+ (useSharedNetwork ? " --hostname-backchannel-dynamic true" : "");
String finalStartCommand = startCommand.orElse(KEYCLOAK_QUARKUS_START_CMD);
if (features.isPresent()) {
finalStartCommand += (" --features=" + features.get().stream().collect(Collectors.joining(",")));
}
Expand Down

0 comments on commit 8b51493

Please sign in to comment.