Skip to content

Instantly share code, notes, and snippets.

@ewrenn8
Last active March 12, 2024 22:50
Show Gist options
  • Save ewrenn8/3409e44252f93497a9b447900f3fb5b7 to your computer and use it in GitHub Desktop.
Save ewrenn8/3409e44252f93497a9b447900f3fb5b7 to your computer and use it in GitHub Desktop.
Regex Matching in Overlays
metadata:
name: contour-certgen
annotations:
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:regexp", "regexp")
#@ def regex_match(x, l, r):
#@ if not ("metadata" in l and "name" in l["metadata"]):
#@ return False
#@ end
#@ return regexp.match("contour-certgen-*", l["metadata"]["name"])
#@ end
#@overlay/match by=regex_match, expects="0+"
---
metadata:
#@overlay/remove
annotations:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment