Last active
March 12, 2024 22:50
-
-
Save ewrenn8/3409e44252f93497a9b447900f3fb5b7 to your computer and use it in GitHub Desktop.
Regex Matching in Overlays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata: | |
name: contour-certgen | |
annotations: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ 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