apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  annotations:
    cert-manager.io/inject-ca-from: "{{ namespace }}/cdi-apiserver-server-cert"
  labels:
    cdi.kubevirt.io: cdi-api
  name: cdi-api-datavolume-mutate
webhooks:
  - admissionReviewVersions:
      - v1
      - v1beta1
    clientConfig:
      service:
        name: cdi-api
        namespace: "{{ namespace }}"
        path: /datavolume-mutate
        port: 443
    failurePolicy: Fail
    matchPolicy: Exact
    name: datavolume-mutate.cdi.kubevirt.io
    namespaceSelector: {}
    objectSelector: {}
    reinvocationPolicy: Never
    rules:
      - apiGroups:
          - cdi.kubevirt.io
        apiVersions:
          - v1beta1
        operations:
          - CREATE
          - UPDATE
        resources:
          - datavolumes
        scope: '*'
    sideEffects: None
    timeoutSeconds: 30