Skip to content

Boolean false overrides silently dropped in multi-document helmfiles since v1.3.0 #2527

Description

@fougner

Operating system

Ubuntu 22.04

Helmfile Version

v1.4.4

Helm Version

v3.18.4

Bug description

seemingly inadvertently broke an existing behavior that has worked since pre v1 days.
The example provided works the same in 0.171.0 and earlier, up until 1.2.3. It breaks in 1.3.0 and above (regression introduced in 70645e0).

In short, overriding helm-defaults with user provided values as per the example helmfile.yaml no longer works and the "defaults" overrides the env-provided helm defaults.

Was the helmfile in the example wrong all this time, or is this an unintended sideeffect? I bisected it to nail down the commit that introduced the behaviorchange; it's PR #2367 (commit 70645e0)

Example helmfile.yaml

Minified example

helmfile.yaml.gotmpl

# helmDefaults boolean false override regression
#
# When environment values are re-assigned mid-helmfile (a common
# pattern for injecting computed/macro values), a later values
# file that sets helmDefaults.atomic: false is silently ignored
# in helmfile >=1.3.0.  helmfile 1.2.x honours it correctly.
#
# Reproduce:
#   helmfile -e myenv -f helmfile.yaml.gotmpl build | grep atomic
#
# Expected:  atomic: false
# Actual:    atomic: true   (helmfile >= 1.3.0)

# 1. Load defaults (sets helmDefaults.atomic: true)
values:
  - defaults.yaml

---

# 2. Define environment
environments:
  myenv:
    values:
      - env-values.yaml

---

# 3. Re-assign environment values.
#    This is the trigger: re-setting the env values causes helmfile
#    to lose the ability to override boolean true→false in later
#    values files.
environments:
  {{ .Environment.Name }}:
    values:
      - {{ toYaml .Environment.Values | nindent 8 }}

---

# 4. Load env-specific overrides (contains helmDefaults.atomic: false)
values:
  - env/{{ .Environment.Name }}/*.yaml

---

helmDefaults:
{{- range $key, $value := (.Values | get "helmDefaults" (dict)) }}
  {{ $key }}: {{ $value }}
{{- end }}

---

releases:
  - name: test-release
    chart: ./empty-chart

env-values.yaml

appName: my-app

defaults.yaml

helmDefaults:
  atomic: true
  wait: true
  timeout: 300

env/myenv/overrides.yaml

helmDefaults:
  atomic: "false"

Error message you've seen (if any)

no error

Steps to reproduce

N/A

Working Helmfile Version

v1.2.3

Relevant discussion

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions