Skip to content

Commit 047eca5

Browse files
committed
Fix devservices with DB backup
1 parent 17aebe1 commit 047eca5

File tree

1 file changed

+2
-5
lines changed
  • infra/horreum-infra-common/src/main/java/io/hyperfoil/tools/horreum/infra/common/resources

1 file changed

+2
-5
lines changed

infra/horreum-infra-common/src/main/java/io/hyperfoil/tools/horreum/infra/common/resources/KeycloakResource.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ public void init(Map<String, String> initArgs) {
3939
throw new RuntimeException("Arguments did not contain Keycloak image");
4040
}
4141

42-
final String JDBC_URL = initArgs.get("quarkus.datasource.jdbc.url.internal");
43-
final String DB_PORT = initArgs.get("postgres.container.port");
44-
4542
final String KEYCLOAK_IMAGE = initArgs.get(HORREUM_DEV_KEYCLOAK_IMAGE);
4643

4744
networkAlias = initArgs.get(HORREUM_DEV_KEYCLOAK_NETWORK_ALIAS);
@@ -73,7 +70,7 @@ public void init(Map<String, String> initArgs) {
7370
.env("KC_HTTP_ENABLED", "true")
7471
.env("KC_HOSTNAME_STRICT", "false")
7572
.env("DB_DATABASE", "keycloak")
76-
.env("KC_DB_URL", JDBC_URL)
73+
.env("KC_DB_URL", initArgs.get("quarkus.datasource.jdbc.url.internal"))
7774
.run("/opt/keycloak/bin/kc.sh build")
7875
.entryPoint("/opt/keycloak/bin/kc.sh ${KEYCLOAK_COMMAND:-start-dev} --import-realm $EXTRA_OPTIONS")
7976
.build()).withFileFromFile("/tmp/keycloak-horreum.json", tempKeycloakRealmFile);
@@ -100,7 +97,7 @@ public void init(Map<String, String> initArgs) {
10097
.withEnv("KC_DB_URL_HOST", "")
10198
.withEnv("KC_HOSTNAME_STRICT", "false")
10299
.withEnv("KC_HOSTNAME", "localhost")
103-
.withEnv("KC_DB_URL", "jdbc:postgresql://172.17.0.1:" + DB_PORT + "/keycloak")
100+
.withEnv("KC_DB_URL", "jdbc:postgresql://" + initArgs.get(HORREUM_DEV_POSTGRES_NETWORK_ALIAS) + ":5432/keycloak")
104101
.withCommand("-Dquarkus.http.http2=false", "start-dev");
105102
}
106103

0 commit comments

Comments
 (0)