# This patch adds excluded namespaces
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: lifecycle-mutating-webhook-configuration
  labels:
    app.kubernetes.io/part-of: keptn
# Add an exclusion rule for the Mutating Webhook since the lifecycle-operator pod will not be able to start since it's waiting for
# itself otherwise control-plane: controller-manager
webhooks:
  - name: mpod.keptn.sh
    namespaceSelector:
      matchExpressions:
        - key: control-plane
          operator: NotIn
          values:
            - "lifecycle-operator"
        - key: kubernetes.io/metadata.name
          operator: NotIn
          values:
            - "kube-system"
            - "kube-public"
            - "kube-node-lease"
            - "cert-manager"
            - "keptn-system"
            - "observability"
            - "monitoring"
