add application release validatingWebhook (#2170)

* add application release validatingWebhook

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* enable at host cluster

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

---------

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>
Co-authored-by: wenhaozhou <wenhaozhou@yunify.com>
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
KubeSphere CI Bot
2025-01-07 17:08:20 +08:00
committed by ks-ci-bot
parent 403744a1ab
commit d0c7cb156f
3 changed files with 105 additions and 0 deletions

View File

@@ -427,3 +427,39 @@ webhooks:
scope: '*'
sideEffects: None
timeoutSeconds: 30
---
{{- if eq (include "multicluster.role" .) "host" }}
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: applications.kubesphere.io
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ b64enc $ca.Cert | quote }}
service:
name: ks-controller-manager
namespace: {{ .Release.Namespace }}
path: /validate-application-kubesphere-io-v2-applicationrelease
port: 443
failurePolicy: Fail
matchPolicy: Exact
name: applicationrelease.extensions.kubesphere.io
namespaceSelector: {}
objectSelector: {}
rules:
- apiGroups:
- application.kubesphere.io
apiVersions:
- v2
operations:
- CREATE
- UPDATE
resources:
- applicationreleases
scope: '*'
sideEffects: None
timeoutSeconds: 30
{{- end }}