mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
fix: further refining when profile info is logged (#42483)
closes: #42334 Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
parent
6ea3c8aedf
commit
3724409c5e
@ -251,10 +251,6 @@ class KeycloakProcessor {
|
||||
void configureProfile(KeycloakRecorder recorder) {
|
||||
Profile profile = getCurrentOrCreateFeatureProfile();
|
||||
|
||||
if (!Environment.isRebuildCheck()) {
|
||||
profile.logUnsupportedFeatures();
|
||||
}
|
||||
|
||||
// record the features so that they are not calculated again at runtime
|
||||
recorder.configureProfile(profile.getName(), profile.getFeatures());
|
||||
}
|
||||
|
||||
@ -135,13 +135,6 @@ public abstract class AbstractAutoBuildCommand extends AbstractCommand {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls whether the command actually starts the server
|
||||
*/
|
||||
protected boolean shouldStart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void doBeforeRun() {
|
||||
|
||||
}
|
||||
@ -156,4 +149,9 @@ public abstract class AbstractAutoBuildCommand extends AbstractCommand {
|
||||
return EnumSet.of(OptionCategory.IMPORT, OptionCategory.EXPORT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldStart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -144,4 +144,11 @@ public abstract class AbstractCommand implements Callable<Integer> {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls whether the command actually starts the server
|
||||
*/
|
||||
public boolean shouldStart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ public abstract class AbstractUpdatesCommand extends AbstractAutoBuildCommand {
|
||||
OptimizedMixin optimizedMixin = new OptimizedMixin();
|
||||
|
||||
@Override
|
||||
protected boolean shouldStart() {
|
||||
public boolean shouldStart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import io.smallrye.config.ConfigValue;
|
||||
import io.smallrye.config.Expressions;
|
||||
import jakarta.ws.rs.core.MultivaluedHashMap;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.keycloak.common.Profile;
|
||||
import org.keycloak.common.util.CollectionUtil;
|
||||
import org.keycloak.config.ConfigSupportLevel;
|
||||
import org.keycloak.config.Option;
|
||||
@ -313,6 +314,10 @@ public final class PropertyMappers {
|
||||
PersistedConfigSource.getInstance().runWithDisabled(Environment::getCurrentOrCreateFeatureProfile);
|
||||
} else {
|
||||
Environment.getCurrentOrCreateFeatureProfile();
|
||||
if (!command.shouldStart()) {
|
||||
// this will use the deferred logger, which means it may not be seen in some circumstances
|
||||
Profile.getInstance().logUnsupportedFeatures();
|
||||
}
|
||||
}
|
||||
|
||||
sanitizeMappers(buildTimeMappers, disabledBuildTimeMappers);
|
||||
|
||||
@ -34,7 +34,9 @@ public class FeaturesDistTest {
|
||||
.filter(feature -> feature.getType() == Profile.Feature.Type.PREVIEW)
|
||||
.filter(feature -> {
|
||||
Set<Profile.Feature> versions = Profile.getFeatureVersions(feature.getUnversionedKey());
|
||||
if (versions.size() == 1) return true;
|
||||
if (versions.size() == 1) {
|
||||
return true;
|
||||
}
|
||||
return versions.iterator().next().getVersion() == feature.getVersion();
|
||||
})
|
||||
.map(Profile.Feature::getVersionedKey)
|
||||
@ -58,12 +60,12 @@ public class FeaturesDistTest {
|
||||
assertPreviewFeaturesEnabled(cliResult);
|
||||
}
|
||||
|
||||
// Should enable "fips" together with all other "preview" features
|
||||
// Should enable "docker" together with all other "preview" features
|
||||
@Test
|
||||
@Launch({StartDev.NAME, "--features=preview,fips"})
|
||||
public void testEnablePreviewFeaturesAndFips(CLIResult cliResult) {
|
||||
@Launch({StartDev.NAME, "--features=preview,docker"})
|
||||
public void testEnablePreviewFeaturesAndDocker(CLIResult cliResult) {
|
||||
cliResult.assertStartedDevMode();
|
||||
assertPreviewFeaturesEnabled(cliResult);
|
||||
cliResult.assertError("Failed to configure FIPS.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -59,7 +59,6 @@ public abstract class KeycloakApplication extends Application {
|
||||
try {
|
||||
|
||||
logger.debugv("PlatformProvider: {0}", platform.getClass().getName());
|
||||
Profile.getInstance().logUnsupportedFeatures();
|
||||
loadConfig();
|
||||
|
||||
platform.onStartup(this::startup);
|
||||
@ -71,6 +70,7 @@ public abstract class KeycloakApplication extends Application {
|
||||
}
|
||||
|
||||
protected void startup() {
|
||||
Profile.getInstance().logUnsupportedFeatures();
|
||||
CryptoIntegration.init(KeycloakApplication.class.getClassLoader());
|
||||
KeycloakApplication.sessionFactory = createSessionFactory();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user