From b8070ea9e54a1bdc0023cc753489b1a235c16ca6 Mon Sep 17 00:00:00 2001 From: jiahui Date: Wed, 18 Mar 2026 11:47:20 +0800 Subject: [PATCH] skip the validate webhook for admin account --- controllers/account/api/v1/debt_webhook.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/account/api/v1/debt_webhook.go b/controllers/account/api/v1/debt_webhook.go index 5382ad0d8da5..a96fc268a446 100644 --- a/controllers/account/api/v1/debt_webhook.go +++ b/controllers/account/api/v1/debt_webhook.go @@ -94,6 +94,10 @@ func (d *DebtValidate) Handle(ctx context.Context, req admission.Request) admiss if strings.Contains(req.UserInfo.Username, "user-controller-manager") { break } + if strings.HasSuffix(req.UserInfo.Username, "user-system:admin") { + logger.V(1).Info("pass for ns-admin") + return admission.ValidationResponse(true, "") + } if isWhiteList(req) { return admission.ValidationResponse(true, "") }