mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Avoid code which looks at local files when etcd is configured (#7144)
This situation happens only in gateway nas which supports etcd based `config.json` to support all FS mode features. The issue was we would try to migrate something which doesn't exist when etcd is configured which leads to inconsistent server configs in memory. This PR fixes this situation by properly loading config after initialization, avoiding backend disk config migration to be done only if etcd is not configured.
This commit is contained in:
committed by
kannappanr
parent
526546d588
commit
0a28c28a8c
@@ -545,19 +545,15 @@ func (s *serverConfig) loadToCachedConfigs() {
|
||||
globalIsCompressionEnabled = compressionConf.Enabled
|
||||
}
|
||||
|
||||
if globalIAMValidators == nil {
|
||||
globalIAMValidators = getAuthValidators(s)
|
||||
}
|
||||
globalIAMValidators = getAuthValidators(s)
|
||||
|
||||
if globalPolicyOPA == nil {
|
||||
if s.Policy.OPA.URL != nil && s.Policy.OPA.URL.String() != "" {
|
||||
globalPolicyOPA = iampolicy.NewOpa(iampolicy.OpaArgs{
|
||||
URL: s.Policy.OPA.URL,
|
||||
AuthToken: s.Policy.OPA.AuthToken,
|
||||
Transport: NewCustomHTTPTransport(),
|
||||
CloseRespFn: CloseResponse,
|
||||
})
|
||||
}
|
||||
if s.Policy.OPA.URL != nil && s.Policy.OPA.URL.String() != "" {
|
||||
globalPolicyOPA = iampolicy.NewOpa(iampolicy.OpaArgs{
|
||||
URL: s.Policy.OPA.URL,
|
||||
AuthToken: s.Policy.OPA.AuthToken,
|
||||
Transport: NewCustomHTTPTransport(),
|
||||
CloseRespFn: CloseResponse,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user