apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  labels:
    {{- include "nexus-operator.labels" . | nindent 4 }}
  name: edp-nexus-operator-validating-webhook-configuration-{{ .Release.Namespace }}
webhooks:
  - admissionReviewVersions:
      - v1
    clientConfig:
      service:
        name: edp-nexus-operator-webhook-service
        namespace: {{ .Release.Namespace }}
        path: /validate-edp-epam-com-v1alpha1-nexusrepository
    failurePolicy: Fail
    name: vnexusrepository.kb.io
    namespaceSelector:
      matchExpressions:
        - key: kubernetes.io/metadata.name
          operator: In
          values:
            - {{ .Release.Namespace }}
    rules:
      - apiGroups:
          - edp.epam.com
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
          - UPDATE
        resources:
          - nexusrepositories
        scope: Namespaced
    sideEffects: None
