Last active
February 18, 2020 15:22
-
-
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.
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") | |
metadata: #@ data.values.cluster_metadata | |
platform: #@ data.values.platform |
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 | |
--- | |
platform: | |
vsphere: | |
username: "username-value" | |
password: "password-value" | |
pullSecret: "pullSecret-value" | |
sshPubkey: "ssh-rsa pubkey value" |
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 | |
--- | |
cluster_metadata: | |
name: demo |
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: demo | |
platform: | |
vsphere: | |
username: username-value | |
password: password-value |
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
$ 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