# Copyright Red Hat

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: idp-mgmt-webhook-service
webhooks:
  - name: admission.identityconfig.identitatem.io
    admissionReviewVersions: 
      - v1beta1
    sideEffects: None
    rules:
      - apiGroups:
          - identityconfig.identitatem.io
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
          - UPDATE
        resources:
          - authrealms
      - apiGroups:
          - identityconfig.identitatem.io
        apiVersions:
          - v1alpha1
        operations:
          - CREATE
        resources:
          - idpconfigs
    failurePolicy: Fail
    clientConfig:
      service:
        namespace: default
        name: kubernetes
        path: /apis/admission.identityconfig.identitatem.io/v1alpha1/authrealms