fix: moves unsupported feature logging (#42380)

closes: #42334

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2025-09-05 13:21:20 -04:00 committed by GitHub
parent 05c7c625d3
commit 0897560513
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 6 deletions

View File

@ -342,8 +342,7 @@ public class Profile {
verifyConfig(features); verifyConfig(features);
CURRENT = new Profile(profile, features); return init(profile, features);
return CURRENT;
} }
private static boolean isEnabledByDefault(ProfileName profile, Feature f) { private static boolean isEnabledByDefault(ProfileName profile, Feature f) {
@ -426,8 +425,6 @@ public class Profile {
private Profile(ProfileName profileName, Map<Feature, Boolean> features) { private Profile(ProfileName profileName, Map<Feature, Boolean> features) {
this.profileName = profileName; this.profileName = profileName;
this.features = Collections.unmodifiableMap(features); this.features = Collections.unmodifiableMap(features);
logUnsupportedFeatures();
} }
public static Profile getInstance() { public static Profile getInstance() {
@ -507,7 +504,7 @@ public class Profile {
} }
} }
private void logUnsupportedFeatures() { public void logUnsupportedFeatures() {
logUnsupportedFeatures(Feature.Type.PREVIEW, getPreviewFeatures(), Logger.Level.INFO); logUnsupportedFeatures(Feature.Type.PREVIEW, getPreviewFeatures(), Logger.Level.INFO);
logUnsupportedFeatures(Feature.Type.EXPERIMENTAL, getExperimentalFeatures(), Logger.Level.WARN); logUnsupportedFeatures(Feature.Type.EXPERIMENTAL, getExperimentalFeatures(), Logger.Level.WARN);
logUnsupportedFeatures(Feature.Type.DEPRECATED, getDeprecatedFeatures(), Logger.Level.WARN); logUnsupportedFeatures(Feature.Type.DEPRECATED, getDeprecatedFeatures(), Logger.Level.WARN);

View File

@ -251,6 +251,10 @@ class KeycloakProcessor {
void configureProfile(KeycloakRecorder recorder) { void configureProfile(KeycloakRecorder recorder) {
Profile profile = getCurrentOrCreateFeatureProfile(); Profile profile = getCurrentOrCreateFeatureProfile();
if (!Environment.isRebuildCheck()) {
profile.logUnsupportedFeatures();
}
// record the features so that they are not calculated again at runtime // record the features so that they are not calculated again at runtime
recorder.configureProfile(profile.getName(), profile.getFeatures()); recorder.configureProfile(profile.getName(), profile.getFeatures());
} }

View File

@ -18,6 +18,7 @@ package org.keycloak.services.resources;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.keycloak.Config; import org.keycloak.Config;
import org.keycloak.common.Profile;
import org.keycloak.common.crypto.CryptoIntegration; import org.keycloak.common.crypto.CryptoIntegration;
import org.keycloak.config.ConfigProviderFactory; import org.keycloak.config.ConfigProviderFactory;
import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.exportimport.ExportImportConfig;
@ -58,7 +59,7 @@ public abstract class KeycloakApplication extends Application {
try { try {
logger.debugv("PlatformProvider: {0}", platform.getClass().getName()); logger.debugv("PlatformProvider: {0}", platform.getClass().getName());
Profile.getInstance().logUnsupportedFeatures();
loadConfig(); loadConfig();
platform.onStartup(this::startup); platform.onStartup(this::startup);