diff --git a/cmd/config-current.go b/cmd/config-current.go index f3f2c677b..9894d9dc6 100644 --- a/cmd/config-current.go +++ b/cmd/config-current.go @@ -484,22 +484,6 @@ func lookupConfigs(s config.Config, objAPI ObjectLayer) { getRemoteInstanceTransport = newGatewayHTTPTransport(apiConfig.RemoteTransportDeadline) }) - if globalIsErasure && objAPI != nil { - setDriveCounts := objAPI.SetDriveCounts() - for i, setDriveCount := range setDriveCounts { - sc, err := storageclass.LookupConfig(s[config.StorageClassSubSys][config.Default], setDriveCount) - if err != nil { - logger.LogIf(ctx, fmt.Errorf("Unable to initialize storage class config: %w", err)) - break - } - // if we validated all setDriveCounts and it was successful - // proceed to store the correct storage class globally. - if i == len(setDriveCounts)-1 { - globalStorageClass.Update(sc) - } - } - } - globalCacheConfig, err = cache.LookupConfig(s[config.CacheSubSys][config.Default]) if err != nil { if globalIsGateway { @@ -670,6 +654,22 @@ func applyDynamicConfigForSubSys(ctx context.Context, objAPI ObjectLayer, s conf if err != nil { logger.LogIf(ctx, fmt.Errorf("Unable to update audit kafka targets: %w", err)) } + case config.StorageClassSubSys: + if globalIsErasure && objAPI != nil { + setDriveCounts := objAPI.SetDriveCounts() + for i, setDriveCount := range setDriveCounts { + sc, err := storageclass.LookupConfig(s[config.StorageClassSubSys][config.Default], setDriveCount) + if err != nil { + logger.LogIf(ctx, fmt.Errorf("Unable to initialize storage class config: %w", err)) + break + } + // if we validated all setDriveCounts and it was successful + // proceed to store the correct storage class globally. + if i == len(setDriveCounts)-1 { + globalStorageClass.Update(sc) + } + } + } } globalServerConfigMu.Lock() defer globalServerConfigMu.Unlock() diff --git a/internal/config/config.go b/internal/config/config.go index 400cc7191..8706eaff5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -169,6 +169,7 @@ var SubSystemsDynamic = set.CreateStringSet( LoggerWebhookSubSys, AuditWebhookSubSys, AuditKafkaSubSys, + StorageClassSubSys, ) // SubSystemsSingleTargets - subsystems which only support single target.