#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")

#@ ns = data.values.application.namespace

#@overlay/match by=overlay.subset({"kind": "MutatingWebhookConfiguration"}), expects="0+"
---
webhooks:
  #@overlay/match by=overlay.all, expects="1+"
  - clientConfig:
      service:
        namespace: #@ ns

#@overlay/match by=overlay.subset({"kind": "ValidatingWebhookConfiguration"}), expects="0+"
---
webhooks:
  #@overlay/match by=overlay.all, expects="1+"
  - clientConfig:
      service:
        namespace: #@ ns
