在 TOML 配置上迭代范围

时间:2021-04-07 12:23:34

标签: kubernetes-helm

configProperties: |-

  [group]
    name = '${CBES_GROUP}'

  [group.static]
    memberNumber = 1 # A value from 1 to 'totalMembers', inclusive.

  [logging]
    logDocumentLifecycle = false
    redactionLevel = 'NONE'

  [metrics]
    httpPort = 31415 # Positive = fixed, 0 = ephemeral, -1 = disable HTTP server
    logInterval = '0m' # Set to '0m' to disable metrics logging

我正在尝试使用范围迭代值

{{- define "config.properties" }}
{{- range $k, $v := .Values.configProperties }}
  {{ index $k }}
{{- $v | toYaml | trimSuffix "\n" | indent 4 }}
{{- end }}
{{- end }}

但我面临以下错误: 在 :错误调用包括:模板:cbes-connector/templates/_helpers.tpl:109:27:在 <.Values.configProperties> 处执行“config.properties”:范围无法迭代结束

如果我遗漏了什么,你能支持吗?

0 个答案:

没有答案