diff --git a/controllers/account/api/v1/debt_webhook.go b/controllers/account/api/v1/debt_webhook.go index 85519c937a0..942a9f05bd8 100644 --- a/controllers/account/api/v1/debt_webhook.go +++ b/controllers/account/api/v1/debt_webhook.go @@ -85,9 +85,12 @@ func (d *DebtValidate) Handle(ctx context.Context, req admission.Request) admiss return admission.ValidationResponse(true, "") } // is user sa - if !strings.HasPrefix(g, saPrefix+":ns-") { + if !strings.HasPrefix(g, saPrefix+":user-system") { continue } + if strings.Contains(req.UserInfo.Username, "user-controller-manager") { + break + } if isWhiteList(req) { return admission.ValidationResponse(true, "") } diff --git a/controllers/account/controllers/billing_controller.go b/controllers/account/controllers/billing_controller.go index 3809186bf30..7d78299d9d8 100644 --- a/controllers/account/controllers/billing_controller.go +++ b/controllers/account/controllers/billing_controller.go @@ -172,13 +172,13 @@ func (r *BillingReconciler) SetupWithManager(mgr ctrl.Manager, rateOpts controll own, ok := createEvent.Object.GetLabels()[v1.UserLabelOwnerKey] return ok && getUsername(createEvent.Object.GetName()) == own }, - UpdateFunc: func(updateEvent event.UpdateEvent) bool { + UpdateFunc: func(_ event.UpdateEvent) bool { return false }, - DeleteFunc: func(deleteEvent event.DeleteEvent) bool { + DeleteFunc: func(_ event.DeleteEvent) bool { return false }, - GenericFunc: func(genericEvent event.GenericEvent) bool { + GenericFunc: func(_ event.GenericEvent) bool { return false }, })).