Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct default config source name to check Kubernetes config disabled #35696

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,6 +50,7 @@ public Iterable<ConfigSource> 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(
Expand Down Expand Up @@ -84,7 +84,7 @@ Iterable<ConfigSource> 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())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a constant? IS the other constant still in use?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that this will go away when the TODO is implemented

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I need to improve this a bit. This was a migration as is, so I didn't want to introduce other changes as well. As for the constant, the source is provided by SR Config, so I prefer to add the constant there.

return false;
}
if (configValue.getValue() != null) {
Expand Down