Skip to content

Commit

Permalink
Make sure KC Dev UI page persists after reload
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Sep 1, 2021
1 parent 127200b commit 0364799
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 0364799

Please sign in to comment.