fix: remove unnecessary panic in iam-store (#19050)

This commit is contained in:
Aditya Manthramurthy 2024-02-13 19:29:36 -08:00 committed by GitHub
parent f8e15e7d09
commit a14e192376
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2429,17 +2429,11 @@ func (store *IAMStoreSys) GetSTSAndServiceAccounts() []auth.Credentials {
var res []auth.Credentials
for _, u := range cache.iamUsersMap {
cred := u.Credentials
if cred.IsTemp() {
panic("unexpected STS credential found in iamUsersMap")
}
if cred.IsServiceAccount() {
res = append(res, cred)
}
}
for _, u := range cache.iamSTSAccountsMap {
if !u.Credentials.IsTemp() {
panic("unexpected non STS credential found in iamSTSAccountsMap")
}
res = append(res, u.Credentials)
}