fix: a regression in loading replication creds (#19204)

fixes #19200

generating STS credentials fail with site-replicated
setup, with this error on a fresh environment.
This commit is contained in:
Harshavardhana 2024-03-05 11:06:17 -08:00 committed by GitHub
parent df57bfcd6c
commit cd7551031b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6207,12 +6207,11 @@ func (s *siteReplicatorCred) Get(ctx context.Context) (auth.Credentials, error)
return s.Creds, nil
}
s.RUnlock()
s.Lock()
defer s.Unlock()
var m map[string]UserIdentity
m := make(map[string]UserIdentity)
if err := globalIAMSys.store.loadUser(ctx, siteReplicatorSvcAcc, svcUser, m); err != nil {
return auth.Credentials{}, err
}
s.Set(m[siteReplicatorSvcAcc].Credentials)
return m[siteReplicatorSvcAcc].Credentials, nil
}