Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix webhook #5068

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion controllers/account/api/v1/debt_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}
Expand Down
6 changes: 3 additions & 3 deletions controllers/account/controllers/billing_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
})).
Expand Down
Loading