Golang template (helm) iterating over a list of maps

后端 未结 2 582
悲哀的现实
悲哀的现实 2021-02-10 02:12

I\'m using helm to generate kubernetes yamls.

My values.yaml looks like this:

...
jobs:
  - nme: job1
    command: [sh, -c, \"/app/deployment/start.sh j         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-10 03:14

    Inside the loop the value of the . is set to the current element and you have to use $.Chart.Name to access your data.

    I asked a similar question and I think the answer https://stackoverflow.com/a/44734585/8131948 will answer your question too.

提交回复
热议问题