From 31d4278913dbdc920ac14a414cc9cf11e55f756b Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Sat, 2 Sep 2023 18:46:09 +0100 Subject: [PATCH] Use correct default config source name to check Kubernetes config disabled --- .../config/runtime/KubernetesConfigSourceFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java b/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java index 7dfc1b79a389e..f3a98ccec4ea5 100644 --- a/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java +++ b/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactory.java @@ -11,7 +11,6 @@ import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.client.KubernetesClient; -import io.quarkus.runtime.configuration.AbstractRawDefaultConfigSource; import io.smallrye.config.ConfigSourceContext; import io.smallrye.config.ConfigSourceContext.ConfigSourceContextConfigSource; import io.smallrye.config.ConfigSourceFactory; @@ -51,6 +50,7 @@ public Iterable getConfigSources(final ConfigSourceContext context .getConfigMapping(KubernetesConfigBuildTimeConfig.class); KubernetesConfigSourceConfig kubernetesConfigSourceConfig = config.getConfigMapping(KubernetesConfigSourceConfig.class); + // TODO - radcortez - Move the check that uses the build time config to the processor and skip the builder registration if ((!kubernetesConfigSourceConfig.enabled() && !kubernetesConfigBuildTimeConfig.secretsEnabled()) || isExplicitlyDisabled(context)) { log.debug( @@ -84,7 +84,7 @@ Iterable getConfigSources(final KubernetesConfigSourceConfig confi private boolean isExplicitlyDisabled(ConfigSourceContext context) { ConfigValue configValue = context.getValue("quarkus.kubernetes-config.enabled"); - if (AbstractRawDefaultConfigSource.NAME.equals(configValue.getConfigSourceName())) { + if ("DefaultValuesConfigSource".equals(configValue.getConfigSourceName())) { return false; } if (configValue.getValue() != null) {