diff --git a/build/base-package/wizard/config/settings/templates/system_namespace.yaml b/build/base-package/wizard/config/settings/templates/system_namespace.yaml index 43d0f996a..f8b3803aa 100644 --- a/build/base-package/wizard/config/settings/templates/system_namespace.yaml +++ b/build/base-package/wizard/config/settings/templates/system_namespace.yaml @@ -17,6 +17,7 @@ metadata: kubesphere.io/creator: '{{ .Values.user.name }}' labels: kubesphere.io/workspace: system-workspace + openpolicyagent.org/webhook: ignore name: os-platform --- diff --git a/platform/open-policy-agent/.olares/config/cluster/deploy/deployment.yaml b/platform/open-policy-agent/.olares/config/cluster/deploy/deployment.yaml index 7c001f056..f71573754 100644 --- a/platform/open-policy-agent/.olares/config/cluster/deploy/deployment.yaml +++ b/platform/open-policy-agent/.olares/config/cluster/deploy/deployment.yaml @@ -106,7 +106,10 @@ metadata: name: opa-validating-webhook webhooks: - name: validating-webhook.openpolicyagent.org - admissionReviewVersions: ["v1beta1"] + admissionReviewVersions: ["v1", "v1beta1"] + namespaceSelector: + matchExpressions: + - {key: openpolicyagent.org/webhook, operator: NotIn, values: [ignore]} rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["*"] @@ -142,6 +145,12 @@ metadata: data: main: | package system + + default uid := "" + uid := input.request.uid + main = { - "response": {"allowed": true}, + "apiVersion": "admission.k8s.io/v1", + "kind": "AdmissionReview", + "response": {"allowed": true, "uid": uid}, } \ No newline at end of file