Last active
October 13, 2020 09:44
-
-
Save m0un10/424d1a3bdacaa76863cb34b5249ab881 to your computer and use it in GitHub Desktop.
YTT with overlay for single item from array
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
#@data/values | |
--- | |
resources: | |
- uri: /service-A/v1 | |
name: this-is-a-test | |
- uri: /service-A/v2 | |
name: this-is-also-a-test |
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") | |
#@data/values | |
--- | |
resources: | |
#@overlay/match by=overlay.not_op(overlay.subset({"uri": "/service-A/v1"})),expects="1+" | |
#@overlay/remove | |
- |
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:data", "data") | |
#@ for api in data.values.resources: | |
#@ if hasattr(api, "uri"): | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: #@ api.name | |
#@ end | |
#@ end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment