---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  labels:
    tkg.tanzu.vmware.com/addon-webhooks: "addon-webhooks"
  name: validating-webhook-configuration
webhooks:
  - admissionReviewVersions:
      - v1
      - v1beta1
    clientConfig:
      service:
        name: tanzu-addons-manager-webhook-service
        namespace: tkg-system
        path: /validate-cni-tanzu-vmware-com-v1alpha1-antreaconfig
        port: 9443
    failurePolicy: Fail
    name: vantreaconfig.kb.io
    rules:
      - apiGroups:
          - cni.tanzu.vmware.com
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
          - UPDATE
        resources:
          - antreaconfigs
    sideEffects: None
    timeoutSeconds: 30
  - admissionReviewVersions:
      - v1
      - v1beta1
    clientConfig:
      service:
        name: tanzu-addons-manager-webhook-service
        namespace: tkg-system
        path: /validate-cni-tanzu-vmware-com-v1alpha1-calicoconfig
        port: 9443
    failurePolicy: Fail
    name: vcalicoconfig.kb.io
    rules:
      - apiGroups:
          - cni.tanzu.vmware.com
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
          - UPDATE
        resources:
          - calicoconfigs
    sideEffects: None
    timeoutSeconds: 30
