From 20fd5ce9e675f7a26258e907f12fe2540b6bdeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Muzik=C3=A1=C5=99?= Date: Mon, 5 Aug 2024 16:49:58 +0200 Subject: [PATCH] Fix config sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Václav Muzikář --- .../runtime/configuration/ConfigArgsConfigSource.java | 8 ++++---- .../runtime/configuration/PersistedConfigSource.java | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java index f48654d060f9..9b1a037da082 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java @@ -30,6 +30,7 @@ import java.util.function.Consumer; import java.util.regex.Pattern; +import io.smallrye.config.ConfigValue; import io.smallrye.config.PropertiesConfigSource; import org.keycloak.quarkus.runtime.cli.command.Main; @@ -89,15 +90,14 @@ private static String getRawConfigArgs() { } @Override - public String getValue(String propertyName) { - Map properties = getProperties(); - String value = properties.get(propertyName); + public ConfigValue getConfigValue(String propertyName) { + ConfigValue value = super.getConfigValue(propertyName); if (value != null) { return value; } - return properties.get(propertyName.replace(OPTION_PART_SEPARATOR_CHAR, '.')); + return super.getConfigValue(propertyName.replace(OPTION_PART_SEPARATOR_CHAR, '.')); } private static Map parseArguments() { diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java index ede35466acfc..688846cdd61f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java @@ -32,6 +32,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import io.smallrye.config.ConfigValue; import io.smallrye.config.PropertiesConfigSource; import org.keycloak.quarkus.runtime.Environment; @@ -54,7 +55,7 @@ public final class PersistedConfigSource extends PropertiesConfigSource { private static final ThreadLocal ENABLED = ThreadLocal.withInitial(() -> true); private PersistedConfigSource() { - super(readProperties(), "", 200); + super(readProperties(), NAME, 200); } public static PersistedConfigSource getInstance() { @@ -67,15 +68,15 @@ public String getName() { } @Override - public String getValue(String propertyName) { + public ConfigValue getConfigValue(String propertyName) { if (isEnabled()) { - String value = super.getValue(propertyName); + ConfigValue value = super.getConfigValue(propertyName); if (value != null) { return value; } - return super.getValue(propertyName.replace(Configuration.OPTION_PART_SEPARATOR_CHAR, '.')); + return super.getConfigValue(propertyName.replace(Configuration.OPTION_PART_SEPARATOR_CHAR, '.')); } return null;