mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
initialize IAM as soon as object layer is initialized (#10700)
Allow requests to come in for users as soon as object layer and config are initialized, this allows users to be authenticated sooner and would succeed automatically on servers which are yet to fully initialize.
This commit is contained in:
@@ -300,14 +300,14 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
||||
}
|
||||
newObject = NewGatewayLayerWithLocker(newObject)
|
||||
|
||||
// Calls all New() for all sub-systems.
|
||||
newAllSubsystems()
|
||||
|
||||
// Once endpoints are finalized, initialize the new object api in safe mode.
|
||||
globalObjLayerMutex.Lock()
|
||||
globalObjectAPI = newObject
|
||||
globalObjLayerMutex.Unlock()
|
||||
|
||||
// Calls all New() for all sub-systems.
|
||||
newAllSubsystems()
|
||||
|
||||
if gatewayName == NASBackendGateway {
|
||||
buckets, err := newObject.ListBuckets(GlobalContext)
|
||||
if err != nil {
|
||||
@@ -326,6 +326,8 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
||||
|
||||
if enableIAMOps {
|
||||
// Initialize users credentials and policies in background.
|
||||
globalIAMSys.InitStore(newObject)
|
||||
|
||||
go globalIAMSys.Init(GlobalContext, newObject)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user