fix nsnp webhook to validate all fileds in it

such as ipblock, service.
And the crd openAPIV3Schema could not validate all scenarios

Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
This commit is contained in:
Duan Jiong
2020-06-28 09:44:05 +08:00
parent 52abbeb355
commit 655fd26cbf
3 changed files with 156 additions and 20 deletions

View File

@@ -2,23 +2,23 @@ apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: kubesphere-nsnp-validate-service
name: kubesphere-nsnp-validate
webhooks:
- clientConfig:
caBundle: <caBundle>
service:
name: kubesphere-controller-manager-service
namespace: kubesphere-system
path: /validate-service-nsnp-kubesphere-io-v1alpha1-network
path: /validate-nsnp-kubesphere-io-v1alpha1-network
failurePolicy: Fail
name: validate.nsnp.kubesphere.io
rules:
- apiGroups:
- ""
- network.kubesphere.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- services
- namespacenetworkpolicies