Golang template (helm) iterating over a list of maps

后端 未结 2 1257
不知归路
不知归路 2021-02-10 02:17

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条回答
  •  误落风尘
    2021-02-10 03:15

    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.

提交回复
热议问题