Skip to content

Instantly share code, notes, and snippets.

@tommituura
Last active February 18, 2020 15:22
Show Gist options
  • Save tommituura/9d366a8ad5bcddf724526f5db9e5ad68 to your computer and use it in GitHub Desktop.
Save tommituura/9d366a8ad5bcddf724526f5db9e5ad68 to your computer and use it in GitHub Desktop.
ytt templating, how to combine values from two yamls into third? NOT WORKING, HELP NEEDED.
#@ load("@ytt:data", "data")
metadata: #@ data.values.cluster_metadata
platform: #@ data.values.platform
#@data/values
---
platform:
vsphere:
username: "username-value"
password: "password-value"
pullSecret: "pullSecret-value"
sshPubkey: "ssh-rsa pubkey value"
#@data/values
---
cluster_metadata:
name: demo
metadata:
name: demo
platform:
vsphere:
username: username-value
password: password-value
$ ytt -f config.yaml -f demo-secrets.yaml -f demo-values.yaml
ytt: Error: Overlaying data values (in following order: demo-secrets.yaml, demo-values.yaml, additional data values):
Document on line demo-values.yaml:2: Map item (key 'cluster_metadata') on line demo-values.yaml:3:
Expected number of matched nodes to be 1, but was 0
I'm sorry to say that https://get-ytt.io/#example:example-multiple-data-values has not helped me.
I have tried to pepper the demo-*.yaml files with #@overlay/match missing_ok=True where I think they could relevantly
go, to no avail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment