allow in-memory persistence for gateway (#13694)

NAS gateway would persist however with or without etcd as before.
This commit is contained in:
Harshavardhana
2021-11-18 23:47:02 -08:00
committed by GitHub
parent 7b82411e6f
commit 81d19156e9
2 changed files with 53 additions and 1 deletions

View File

@@ -151,7 +151,13 @@ func (sys *IAMSys) initStore(objAPI ObjectLayer, etcdClient *etcd.Client) {
if etcdClient == nil {
if globalIsGateway {
sys.store = &IAMStoreSys{newIAMDummyStore(sys.usersSysType)}
if globalGatewayName == NASBackendGateway {
sys.store = &IAMStoreSys{newIAMObjectStore(objAPI, sys.usersSysType)}
} else {
sys.store = &IAMStoreSys{newIAMDummyStore(sys.usersSysType)}
logger.Info("WARNING: %s gateway is running in-memory IAM store, for persistence please configure etcd",
globalGatewayName)
}
} else {
sys.store = &IAMStoreSys{newIAMObjectStore(objAPI, sys.usersSysType)}
}