我有一个带有属性 2darrayIPs 的舵图。此属性从 values.yaml 文件中获取值,该文件又通过 helm 安装命令给出
掌舵图/模板/main.yaml
2darrayIPs: {{ .Values.2darrayIPs }}
掌舵图/values.yaml
2darrayIPs: [[]] -- empty array, this value is given via installation command
我在安装 helm 图表时通过 helm 命令传递 2d 数组。
helm install ..... -f val.yaml
val.yaml
2darrayIPs:
- - 1.1.1.1
- 2.2.2.2
- - 3.3.3.3
- 4.4.4.4
安装 helm chart 时出现此错误:
Error: YAML parse error on templates/main.yaml: error converting YAML to JSON: yaml: did not find expected ',' or ']'
如果我如下给出一个数组,则安装成功,但在我的日志中,我得到一个只有一个值而不是两个值的数组:
[[1.1.1.1 2.2.2.2]]
val.yaml
2darrayIPs:
- - 1.1.1.1
- 2.2.2.2
我哪里错了?