mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Fix config leaks and deprecate file-based config setters in NAS gateway (#9884)
This PR has the following changes - Removing duplicate lookupConfigs() calls. - Deprecate admin config APIs for NAS gateways. This will avoid repeated reloads of the config from the disk. - WatchConfigNASDisk will be removed - Migration guide for NAS gateways users to migrate to ENV settings. NOTE: THIS PR HAS A BREAKING CHANGE Fixes #9875 Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -482,12 +482,12 @@ func lookupConfigs(s config.Config) {
|
||||
}
|
||||
}
|
||||
|
||||
globalConfigTargetList, err = notify.GetNotificationTargets(s, GlobalContext.Done(), NewGatewayHTTPTransport())
|
||||
globalConfigTargetList, err = notify.GetNotificationTargets(s, GlobalContext.Done(), NewGatewayHTTPTransport(), false)
|
||||
if err != nil {
|
||||
logger.LogIf(ctx, fmt.Errorf("Unable to initialize notification target(s): %w", err))
|
||||
}
|
||||
|
||||
globalEnvTargetList, err = notify.GetNotificationTargets(newServerConfig(), GlobalContext.Done(), NewGatewayHTTPTransport())
|
||||
globalEnvTargetList, err = notify.GetNotificationTargets(newServerConfig(), GlobalContext.Done(), NewGatewayHTTPTransport(), true)
|
||||
if err != nil {
|
||||
logger.LogIf(ctx, fmt.Errorf("Unable to initialize notification target(s): %w", err))
|
||||
}
|
||||
@@ -579,9 +579,6 @@ func newSrvConfig(objAPI ObjectLayer) error {
|
||||
// Initialize server config.
|
||||
srvCfg := newServerConfig()
|
||||
|
||||
// Override any values from ENVs.
|
||||
lookupConfigs(srvCfg)
|
||||
|
||||
// hold the mutex lock before a new config is assigned.
|
||||
globalServerConfigMu.Lock()
|
||||
globalServerConfig = srvCfg
|
||||
|
||||
Reference in New Issue
Block a user