apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: topolvm-hook
  annotations:
    cert-manager.io/inject-ca-from: topolvm-system/mutatingwebhook
  labels:
    app.kubernetes.io/name: topolvm-hook
webhooks:
  - admissionReviewVersions:
    - v1
    - v1beta1
    clientConfig:
      service:
        namespace: topolvm-system
        name: controller
        path: /pvc/mutate
    failurePolicy: Fail
    matchPolicy: Equivalent
    name: pvc-hook.topolvm.cybozu.com
    rules:
    - apiGroups:
      - ""
      apiVersions:
      - v1
      operations:
      - CREATE
      resources:
      - persistentvolumeclaims
    sideEffects: None
    namespaceSelector:
      matchExpressions:
      - key: topolvm.cybozu.com/webhook
        operator: NotIn
        values:
          - "ignore"
  - admissionReviewVersions:
    - v1
    - v1beta1
    clientConfig:
      service:
        namespace: topolvm-system
        name: controller
        path: /pod/mutate
    failurePolicy: Fail
    matchPolicy: Equivalent
    name: pod-hook.topolvm.cybozu.com
    rules:
    - apiGroups:
      - ""
      apiVersions:
      - v1
      operations:
      - CREATE
      resources:
      - pods
    sideEffects: None
    namespaceSelector:
      matchExpressions:
      - key: topolvm.cybozu.com/webhook
        operator: NotIn
        values:
          - "ignore"

