eric-maynard commented on code in PR #1376:
URL: https://github.com/apache/polaris/pull/1376#discussion_r2045053548
##########
quarkus/service/src/main/java/org/apache/polaris/service/quarkus/config/QuarkusProducers.java:
##########
@@ -159,9 +163,68 @@ public void maybeBootstrap(
MetaStoreManagerFactory factory,
QuarkusPersistenceConfiguration config,
RealmContextConfiguration realmContextConfiguration) {
+ var rootCredentialsSet = RootCredentialsSet.fromEnvironment();
+ var rootCredentials = rootCredentialsSet.credentials();
if (config.isAutoBootstrap()) {
- RootCredentialsSet rootCredentialsSet =
RootCredentialsSet.fromEnvironment();
- factory.bootstrapRealms(realmContextConfiguration.realms(),
rootCredentialsSet);
+ var realmIds = realmContextConfiguration.realms();
+
+ LOGGER.info(
+ "Bootstrapping realm(s) {}, if necessary, from root credentials set
provided via the environment variable {} or Java system property {} ...",
+ realmIds.stream().map(r -> "'" + r +
"'").collect(Collectors.joining(", ")),
+ RootCredentialsSet.ENVIRONMENT_VARIABLE,
+ RootCredentialsSet.SYSTEM_PROPERTY);
+
+ var result = factory.bootstrapRealms(realmIds, rootCredentialsSet);
+
+ result.forEach(
+ (realm, secrets) -> {
+ var principalSecrets = secrets.getPrincipalSecrets();
+
+ var log =
+ LOGGER
+ .atInfo()
+ .addArgument(realm)
+ .addArgument(RootCredentialsSet.ENVIRONMENT_VARIABLE)
+ .addArgument(RootCredentialsSet.SYSTEM_PROPERTY);
+ if (rootCredentials.containsKey(realm)) {
+ log.log(
+ "Realm '{}' automatically bootstrapped, credentials taken
from root credentials set provided via the environment variable {} or Java
system property {}, not printed to stdout.");
+ } else {
+ log.log(
+ "Realm '{}' automatically bootstrapped, credentials were not
present in root credentials set provided via the environment variable {} or
Java system property {}, see separate message printed to stdout.");
Review Comment:
In the admin tool
[here](https://github.com/eric-maynard/polaris/blob/e9e53052abf5f72d9629fc79e2a9e43859c3286c/quarkus/admin/src/main/java/org/apache/polaris/admintool/BootstrapCommand.java#L116)
we gate this behind a command-line argument, do we need to do something
similar here or should we always print?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]