{{if .AdmissionController}}
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: kuryr-dns-admission-controller
  labels:
    app: kuryr-dns-admission-controller
webhooks:
  - name: kuryr-dns-admission-controller.openshift.io
    failurePolicy: Ignore
    sideEffects: None
    admissionReviewVersions: ['v1', 'v1beta1']
    clientConfig:
      service:
        name: kuryr-dns-admission-controller
        namespace: openshift-kuryr
        path: "/"
      caBundle: {{ .WebhookCA }}
    rules:
      - operations: ["CREATE"]
        apiGroups: [""]
        apiVersions: ["*"]
        resources: ["pods"]
{{- end}}
