fix: remove the transformation of health-enabled false (#36877)

closes: #36874

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2025-01-28 13:57:47 -05:00 committed by GitHub
parent 827e82ad25
commit ce09061264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 12 deletions

View File

@ -12,7 +12,8 @@ final class HealthPropertyMappers {
public static PropertyMapper<?>[] getHealthPropertyMappers() {
return new PropertyMapper[] {
fromOption(HealthOptions.HEALTH_ENABLED)
.to("quarkus.smallrye-health.extensions.enabled")
// no need to map to a quarkus option, this option exists to
// to control artifact / extension inclusion. Quarkus will default to enabled
.build()
};
}

View File

@ -5,9 +5,6 @@ quarkus.http.root-path=/
quarkus.application.name=Keycloak
quarkus.banner.enabled=false
# Disable health checks from extensions, since we provide our own (default is true)
quarkus.smallrye-health.extensions.enabled=false
# Enables metrics from other extensions if metrics is enabled
quarkus.datasource.metrics.enabled=${quarkus.micrometer.enabled:false}

View File

@ -22,7 +22,6 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.keycloak.quarkus.runtime.Environment.isWindows;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.Arrays;
@ -207,7 +206,7 @@ public class ConfigurationTest extends AbstractConfigurationTest {
assertEquals(MariaDBDialect.class.getName(), config.getConfigValue("kc.db-dialect").getValue());
assertEquals("jdbc:mariadb:aurora://foo/bar?a=1&b=2", config.getConfigValue("quarkus.datasource.jdbc.url").getValue());
}
@Test
public void testExpansionDisabled() {
ConfigArgsConfigSource.setCliArgs("--db=mysql");
@ -431,12 +430,10 @@ public class ConfigurationTest extends AbstractConfigurationTest {
@Test
public void testResolveHealthOption() {
ConfigArgsConfigSource.setCliArgs("--health-enabled=true");
SmallRyeConfig config = createConfig();
assertEquals("true", config.getConfigValue("quarkus.smallrye-health.extensions.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("");
config = createConfig();
assertEquals("false", config.getConfigValue("quarkus.smallrye-health.extensions.enabled").getValue());
SmallRyeConfig config = createConfig();
// default to null when the extension is effectively removed
assertNull(config.getConfigValue("quarkus.smallrye-health.extensions.enabled").getValue());
}
@Test
@ -521,8 +518,9 @@ public class ConfigurationTest extends AbstractConfigurationTest {
.collect(Collectors.toSet());
StringBuilder sb = new StringBuilder();
for (String cache : maxCountCaches)
for (String cache : maxCountCaches) {
sb.append(" --").append(CachingOptions.cacheMaxCountProperty(cache)).append("=").append(maxCount);
}
String args = sb.toString();
ConfigArgsConfigSource.setCliArgs(args.split(" "));