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

Make sure KC Dev UI page persists after reload #19820

Merged
merged 1 commit into from
Sep 1, 2021
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 @@ -93,6 +93,7 @@ public class KeycloakDevServicesProcessor {
private static volatile String capturedKeycloakUrl;
private static volatile FileTime capturedRealmFileLastModifiedDate;
private final IsDockerWorking isDockerWorking = new IsDockerWorking(true);
private static volatile KeycloakDevServicesConfigBuildItem existingDevServiceConfig;

@BuildStep(onlyIfNot = IsNormal.class, onlyIf = { IsEnabled.class, GlobalDevServicesConfig.Enabled.class })
public KeycloakDevServicesConfigBuildItem startKeycloakContainer(
Expand Down Expand Up @@ -121,7 +122,7 @@ public KeycloakDevServicesConfigBuildItem startKeycloakContainer(
}
}
if (!restartRequired) {
return null;
return existingDevServiceConfig;
}
for (Closeable closeable : closeables) {
try {
Expand All @@ -133,6 +134,7 @@ public KeycloakDevServicesConfigBuildItem startKeycloakContainer(
closeables = null;
capturedDevServicesConfiguration = null;
capturedKeycloakUrl = null;
existingDevServiceConfig = null;
}
capturedDevServicesConfiguration = currentDevServicesConfiguration;

Expand Down Expand Up @@ -212,7 +214,8 @@ private KeycloakDevServicesConfigBuildItem prepareConfiguration(boolean createRe
configProperties.put(CLIENT_SECRET_CONFIG_KEY, oidcClientSecret);
configProperties.put(OIDC_USERS, users);

return new KeycloakDevServicesConfigBuildItem(configProperties);
existingDevServiceConfig = new KeycloakDevServicesConfigBuildItem(configProperties);
return existingDevServiceConfig;
}

private StartResult startContainer(boolean useSharedContainer) {
Expand Down