Skip to content

Commit

Permalink
Remove customizer mappings from runtime recording Config
Browse files Browse the repository at this point in the history
(cherry picked from commit ada7e07)
  • Loading branch information
radcortez authored and gsmet committed Nov 19, 2024
1 parent 84186cd commit 9ea9a9f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import io.smallrye.config.SecretKeys;
import io.smallrye.config.SmallRyeConfig;
import io.smallrye.config.SmallRyeConfigBuilder;
import io.smallrye.config.SmallRyeConfigBuilderCustomizer;
import io.smallrye.config.SysPropConfigSource;
import io.smallrye.config.common.AbstractConfigSource;

Expand Down Expand Up @@ -1112,6 +1113,17 @@ private SmallRyeConfig getConfigForRuntimeRecording() {
builder.getProfiles().add("");
builder.getSources().clear();
builder.getSourceProviders().clear();
builder.withCustomizers(new SmallRyeConfigBuilderCustomizer() {
@Override
public void configBuilder(final SmallRyeConfigBuilder builder) {
builder.getMappingsBuilder().getMappings().clear();
}

@Override
public int priority() {
return Integer.MAX_VALUE;
}
});
builder.setAddDefaultSources(false)
// Customizers may duplicate sources, but not much we can do about it, we need to run them
.addDiscoveredCustomizers()
Expand Down

0 comments on commit 9ea9a9f

Please sign in to comment.