---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  annotations:
    cert-manager.io/inject-ca-from: kube-amd-gpu/amd-gpu-operator-kmm-serving-cert
  labels:
    app.kubernetes.io/instance: amd-gpu-operator
    app.kubernetes.io/name: kmm
    app.kubernetes.io/version: v20240618-v2.1.1
  name: amd-gpu-operator-kmm-validating-webhook-configuration
webhooks:
  - admissionReviewVersions:
      - v1
    clientConfig:
      service:
        name: amd-gpu-operator-kmm-webhook-service
        namespace: kube-amd-gpu
        path: /validate--v1-namespace
    failurePolicy: Fail
    name: namespace-deletion.kmm.sigs.k8s.io
    namespaceSelector:
      matchLabels:
        kmm.node.k8s.io/contains-modules: ""
    rules:
      - apiGroups:
          - ""
        apiVersions:
          - v1
        operations:
          - DELETE
        resources:
          - namespaces
    sideEffects: None
  - admissionReviewVersions:
      - v1
    clientConfig:
      service:
        name: amd-gpu-operator-kmm-webhook-service
        namespace: kube-amd-gpu
        path: /validate-kmm-sigs-x-k8s-io-v1beta1-module
    failurePolicy: Fail
    name: vmodule.kb.io
    rules:
      - apiGroups:
          - kmm.sigs.x-k8s.io
        apiVersions:
          - v1beta1
        operations:
          - CREATE
          - UPDATE
        resources:
          - modules
    sideEffects: None
