From 8856a2d77be79a3b1aae84df2c562eb03521c26a Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 29 Jun 2022 16:32:04 -0700 Subject: [PATCH] finalize startup-banner and remove unnecessary logs (#15202) --- cmd/handler-api.go | 4 +++- cmd/iam.go | 7 ------- cmd/server-startup-msg.go | 3 ++- internal/config/config.go | 4 ++-- internal/config/identity/openid/openid.go | 11 ++++++++++- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/cmd/handler-api.go b/cmd/handler-api.go index a62de3073..470ab0d3b 100644 --- a/cmd/handler-api.go +++ b/cmd/handler-api.go @@ -116,7 +116,9 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) { // + 2 * 10MiB (default erasure block size v1) + 2 * 1MiB (default erasure block size v2) blockSize := xioutil.BlockSizeLarge + xioutil.BlockSizeSmall apiRequestsMaxPerNode = int(maxMem / uint64(maxSetDrives*blockSize+int(blockSizeV1*2+blockSizeV2*2))) - logger.Info("Automatically configured API requests per node based on available memory on the system: %d", apiRequestsMaxPerNode) + if globalIsDistErasure { + logger.Info("Automatically configured API requests per node based on available memory on the system: %d", apiRequestsMaxPerNode) + } } else { apiRequestsMaxPerNode = cfg.RequestsMax if len(globalEndpoints.Hostnames()) > 0 { diff --git a/cmd/iam.go b/cmd/iam.go index 384189eab..1659bfdfe 100644 --- a/cmd/iam.go +++ b/cmd/iam.go @@ -223,8 +223,6 @@ func (sys *IAMSys) Load(ctx context.Context) error { // Init - initializes config system by reading entries from config/iam func (sys *IAMSys) Init(ctx context.Context, objAPI ObjectLayer, etcdClient *etcd.Client, iamRefreshInterval time.Duration) { - iamInitStart := time.Now() - sys.Lock() defer sys.Unlock() @@ -297,8 +295,6 @@ func (sys *IAMSys) Init(ctx context.Context, objAPI ObjectLayer, etcdClient *etc break } - iamLoadStart := time.Now() - // Load IAM data from storage. for { if err := sys.Load(retryCtx); err != nil { @@ -370,9 +366,6 @@ func (sys *IAMSys) Init(ctx context.Context, objAPI ObjectLayer, etcdClient *etc } sys.printIAMRoles() - - now := time.Now() - logger.Info("Finished loading IAM sub-system (took %.1fs of %.1fs).", now.Sub(iamLoadStart).Seconds(), now.Sub(iamInitStart).Seconds()) } func (sys *IAMSys) validateAndAddRolePolicyMappings(ctx context.Context, m map[arn.ARN]string) { diff --git a/cmd/server-startup-msg.go b/cmd/server-startup-msg.go index f363c0bf6..f6a69f620 100644 --- a/cmd/server-startup-msg.go +++ b/cmd/server-startup-msg.go @@ -44,6 +44,7 @@ func mustGetStorageInfo(objAPI ObjectLayer) StorageInfo { // Prints the formatted startup message. func printStartupMessage(apiEndpoints []string, err error) { + logger.Info(color.Bold("MinIO Object Storage Server")) if err != nil { if globalConsoleSys != nil { globalConsoleSys.Send(fmt.Sprintf("Server startup failed with '%v', some features may be missing", err), string(logger.All)) @@ -53,7 +54,7 @@ func printStartupMessage(apiEndpoints []string, err error) { if len(globalSubnetConfig.APIKey) == 0 && err == nil { var builder strings.Builder startupBanner(&builder) - logger.Info("\n" + builder.String()) + logger.Info(builder.String()) } strippedAPIEndpoints := stripStandardPorts(apiEndpoints, globalMinioHost) diff --git a/internal/config/config.go b/internal/config/config.go index 441d48dec..4be94ee51 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1055,10 +1055,10 @@ func (c Config) GetAvailableTargets(subSys string) ([]string, error) { func getEnvVarName(subSys, target, param string) string { if target == Default { - return fmt.Sprintf("%s%s_%s", EnvPrefix, strings.ToUpper(subSys), strings.ToUpper(param)) + return fmt.Sprintf("%s%s%s%s", EnvPrefix, strings.ToUpper(subSys), Default, strings.ToUpper(param)) } - return fmt.Sprintf("%s%s_%s_%s", EnvPrefix, strings.ToUpper(subSys), strings.ToUpper(param), target) + return fmt.Sprintf("%s%s%s%s%s%s", EnvPrefix, strings.ToUpper(subSys), Default, strings.ToUpper(param), Default, target) } var resolvableSubsystems = set.CreateStringSet(IdentityOpenIDSubSys) diff --git a/internal/config/identity/openid/openid.go b/internal/config/identity/openid/openid.go index d9878d473..752e5cd0b 100644 --- a/internal/config/identity/openid/openid.go +++ b/internal/config/identity/openid/openid.go @@ -197,8 +197,17 @@ func LookupConfig(s config.Config, transport http.RoundTripper, closeRespFn func seenClientIDs = set.NewStringSet() ) - // remove this since we have removed support for this already. deprecatedKeys := []string{JwksURL} + + // remove this since we have removed support for this already. + for k := range s[config.IdentityOpenIDSubSys] { + for _, dk := range deprecatedKeys { + kvs := s[config.IdentityOpenIDSubSys][k] + kvs.Delete(dk) + s[config.IdentityOpenIDSubSys][k] = kvs + } + } + if err := s.CheckValidKeys(config.IdentityOpenIDSubSys, deprecatedKeys); err != nil { return c, err }