helmfile
几个月后我第一次重新同步已运行多年的项目时,突然发现key "chart" already set in map
每个项目都出现错误。
我不确定helmfile
它最后在哪个版本上运行(错误至少发生在0.153.1+
),但我发现了一些相关问题这里(初始)和这里(据称已解决)这似乎表明旧版本实际上存在此错误,但新版本解决了它;对我来说,情况恰恰相反。
摘录自helmfile.yaml
:
---
# Based on example https://github.com/costimuraru/helmfile-examples/tree/master/gotmpl
# Ordered list of releases.
helmfiles:
- "common/repos.yaml"
# the rest based on this excellent article: https://www.arthurkoziel.com/managing-helm-charts-with-helmfile/
helmDefaults:
atomic: true
cleanupOnFail: true
templates:
default: &default
chart: charts/{{`{{ .Release.Name }}`}}
missingFileHandler: Warn
values:
- charts/{{`{{ .Release.Name }}`}}/values-{{ .Environment.Name }}.yaml
secrets:
- charts/{{`{{ .Release.Name }}`}}/secrets-{{ .Environment.Name }}.yaml
releases:
- name: metallb
<<: *default
chart: metallb/metallb
namespace: metallb
...
并且输出有错误:
...
first-pass produced: &{default map[] map[]}
first-pass rendering result of "helmfile.yaml.part.0": {default map[] map[]}
vals:
map[]
defaultVals:[]
second-pass rendering result of "helmfile.yaml.part.0":
...
35:
36: - name: metallb
37: <<: *default
38: chart: metallb/metallb
39: namespace: metallb
40:
...
err: failed to read helmfile.yaml: reading document at index 1: yaml: unmarshal errors:
line 39: key "chart" already set in map
编辑:出现了新的搜索同一问题的报告,尚未答复...
答案1
查看:https://github.com/helmfile/helmfile/issues/917
使用其中之一export HELMFILE_GOCCY_GOYAML=true
或使用inherit
发布模板的功能,如下所述:https://helmfile.readthedocs.io/en/latest/writing-helmfile/#release-template-conventional-directory-structure