YAML templating question. I'm using (golang) "goss" to run some http checks.
I'm using a variables file, and rendering/merging it into a yaml template as below.
My question is how to access nested keys. ie I can easily grab {{.url}}
but, how to grab {{ meta.rewriterule}} and {{ meta.jiranumber }}?
http:
{{range index .Vars .Env.TESTS "http"}}
{{.url}}:
title: {{.title}}
status: {{.status}}
allow-insecure: false
no-follow-redirects: true
timeout: 5000
meta:
rewriterule: {{ how to access this key? }}
jiranumber: {{ how to access this key? }}
body:
{{.body}}
{{end}}
I can access the above "url" using {{.url}} in my template above.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
YAML templating question. I'm using (golang) "goss" to run some http checks. I'm using a variables file, and rendering/merging it into a yaml template as below. My question is how to access nested keys. ie I can easily grab {{.url}} but, how to grab {{ meta.rewriterule}} and {{ meta.jiranumber }}?
INPUT FILE (VARIABLE SOURCE)
nonprod: http:
TEMPLATE FILE
http: {{range index .Vars .Env.TESTS "http"}} {{.url}}: title: {{.title}} status: {{.status}} allow-insecure: false no-follow-redirects: true timeout: 5000 meta: rewriterule: {{ how to access this key? }} jiranumber: {{ how to access this key? }} body:
I can access the above "url" using {{.url}} in my template above.
Using the following for example....
I get the following error...
****> executing "test" at <.rewriterule>: map has no entry for key "rewriterule"
...presumably because it should be something like {{ meta.rewriterule }}...which also didn't work :(