Score:0

previously working helmfile now errors out with `key "chart" already set in map`

tr flag

While re-syncing a helmfile that has been running for years for the first time since a few months, I suddenly get errors key "chart" already set in map for every item.

I'm not sure with which helmfile version it last worked (the error occurs at least on 0.153.1+), but I found a few related issues here (initial) and here (allegedly solved) that seem to suggest that actually old versions had this bug but new versions solved it; for me it's exactly the opposite.

An excerpt from the 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

...

and the output with error:

...
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 

EDIT: a new search turned up a report of the same issue, as yet unanswered...

Score:0
nu flag

Check: https://github.com/helmfile/helmfile/issues/917

Use either export HELMFILE_GOCCY_GOYAML=true or use the inherit functionality for release template, as described here: https://helmfile.readthedocs.io/en/latest/writing-helmfile/#release-template-conventional-directory-structure

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.