Skip to content

Instantly share code, notes, and snippets.

@warroyo
Last active July 8, 2022 19:37
Show Gist options
  • Save warroyo/34add0cab0079e54ebd93388d0839119 to your computer and use it in GitHub Desktop.
Save warroyo/34add0cab0079e54ebd93388d0839119 to your computer and use it in GitHub Desktop.
ytt testing
#@data/values
---
extrapools:
- name: tkg-aws-wc-np-1
replicas: 2
az: us-west-2b
nodeMachineType: t3.large
autoscaler_min_size: 2
autoscaler_max_size: 5
tags:
will: testing
will3: testing
labels:
key1: hello
key2: value2
---
additionalTags:
test1: testing
test2: testing
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:yaml", "yaml")
#@ load("@ytt:data", "data")
#@ def merge_tags(pool):
#@ tags = {}
#@ if hasattr(pool, "tags"):
#@ tags.update(pool.tags)
#@ end
#@ return lambda left, right: dict(yaml.decode(yaml.encode(left)).items() + tags.items())
#@ end
#@overlay/match by=overlay.all
#@ for i in data.values.extrapools:
---
#@overlay/replace via=merge_tags(i)
additionalTags:
#@ end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment