8000 fix: consistently resetting the configuration by shawkins · Pull Request #47870 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
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 @@ -10,7 +10,6 @@
import org.keycloak.quarkus.runtime.Environment;
import org.keycloak.quarkus.runtime.configuration.ConfigArgsConfigSource;
import org.keycloak.quarkus.runtime.configuration.Configuration;
import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider;
import org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider;

import io.smallrye.config.SmallRyeConfig;
Expand All @@ -37,9 +36,9 @@ public class PersistenceXmlDatasourcesTest {
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
version="3.0">

%s

</persistence>
""";

Expand Down Expand Up @@ -230,7 +229,6 @@ private static void initConfig(){
// inspired in AbstractConfigurationTest in quarkus/runtime
private static SmallRyeConfig createConfig() {
Configuration.resetConfig();
KeycloakConfigSourceProvider.reload();
Environment.getCurrentOrCreateFeatureProfile();
return Configuration.getConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static synchronized SmallRyeConfig getConfig() {

public static void resetConfig() {
config = null;
KeycloakConfigSourceProvider.reload();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static void addConfigSources(String displayName, Collection<ConfigSource
/**
* For test purposes
*/
public static void reload() {
static void reload() {
CONFIG_SOURCES.clear();
CONFIG_SOURCE_DISPLAY_NAMES.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.keycloak.quarkus.runtime.cli.command.AbstractCommand;
import org.keycloak.quarkus.runtime.configuration.AbstractConfigurationTest;
import org.keycloak.quarkus.runtime.configuration.Configuration;
import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider;
import org.keycloak.quarkus.runtime.configuration.PersistedConfigSource;

import io.smallrye.config.SmallRyeConfig;
Expand Down Expand Up @@ -109,7 +108,6 @@ public void start() {

@Override
public void initConfig(AbstractCommand command) {
KeycloakConfigSourceProvider.reload();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're not calling Configuration.resetConfig() somewhere here, are we?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That call was a workaround for missing it somewhere else when resetting the config. Now that we do it consistently we don't need this one off.

boolean checkBuild = Environment.isRebuildCheck();
super.initConfig(command);
if (!checkBuild && PersistedConfigSource.getInstance().getConfigValueProperties().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ protected static Config.Scope initConfig(String... scope) {

static protected SmallRyeConfig createConfig() {
Configuration.resetConfig();
KeycloakConfigSourceProvider.reload();
Environment.getCurrentOrCreateFeatureProfile();
return Configuration.getConfig();
}
Expand Down
Loading
0