fix: if targetUser empty use parentUser for serviceAccounts (#12275)

This commit is contained in:
Harshavardhana 2021-05-11 13:02:00 -07:00 committed by GitHub
parent 56d4d7b8b1
commit fe21aa356c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -530,6 +530,9 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque
errors.New("service accounts cannot be generated for temporary credentials without parent")), r.URL)
return
}
if targetUser == "" {
targetUser = cred.ParentUser
}
}
targetGroups = cred.Groups
}