site replication: Disallow removal of site-replicator account (#19092)

This commit is contained in:
Poorna 2024-02-21 02:09:33 -08:00 committed by GitHub
parent c44f311c4f
commit 526b829a09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1072,6 +1072,10 @@ func (a adminAPIHandlers) DeleteServiceAccount(w http.ResponseWriter, r *http.Re
return
}
if serviceAccount == siteReplicatorSvcAcc && globalSiteReplicationSys.isEnabled() {
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrInvalidArgument), r.URL)
return
}
// 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, _, err := globalIAMSys.GetServiceAccount(ctx, serviceAccount)