apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  annotations:
    cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "etcd-operator.fullname" . }}-serving-cert
  labels:
    {{- include "etcd-operator.labels" . | nindent 4 }}
  name: {{ include "etcd-operator.fullname" . }}-mutating-webhook-configuration
webhooks:
  - admissionReviewVersions:
      - v1
    clientConfig:
      service:
        name: {{ include "etcd-operator.fullname" . }}-webhook-service
        namespace: {{ .Release.Namespace }}
        path: /mutate-etcd-aenix-io-v1alpha1-etcdcluster
    failurePolicy: Fail
    name: metcdcluster.kb.io
    rules:
      - apiGroups:
          - etcd.aenix.io
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
          - UPDATE
        resources:
          - etcdclusters
    sideEffects: None
