fix: DeleteServiceAccount API behavior (#18163)

This commit is contained in:
Taran Pelkey 2023-10-08 15:13:18 -04:00 committed by GitHub
parent efb03e19e6
commit 18550387d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1147,7 +1147,11 @@ func (a adminAPIHandlers) DeleteServiceAccount(w http.ResponseWriter, r *http.Re
// We do not care if service account is readable or not at this point,
// since this is a delete call we shall allow it to be deleted if possible.
svcAccount, _, _ := globalIAMSys.GetServiceAccount(ctx, serviceAccount)
svcAccount, _, err := globalIAMSys.GetServiceAccount(ctx, serviceAccount)
if errors.Is(err, errNoSuchServiceAccount) {
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminServiceAccountNotFound), r.URL)
return
}
adminPrivilege := globalIAMSys.IsAllowed(policy.Args{
AccountName: cred.AccessKey,