# This patch add annotation to admission webhook config and
# the variables $(NAMESPACE) and $(CERTIFICATENAME) will be substituted by kustomize.

# NOTE: This section on mutating webhooks is commented out for now because we don't have any
# and Kustomize doesn't like apply something to nothing

#apiVersion: admissionregistration.k8s.io/v1
#kind: MutatingWebhookConfiguration
#metadata:
#  name: mutating-webhook-configuration
#  annotations:
#    cert-manager.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: validating-webhook-configuration
  annotations:
    cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
