Skip to content

Regression in map values merging in helm v4 #31643

@vflaux

Description

@vflaux

What happened?

Since helm v4, when you define a map in values.yaml of your chart then override it in a values.yaml with a map containing keys with null value, theses keys/values are not added to the map.

What did you expect to happen?

Keys should be present in the resulting map with null values, as in helm v3.

How can we reproduce it (as minimally and precisely as possible)?

With the following chart

chart/Chart.yaml:

name: foo
version: 0.0.1

chart/templates/foo.yaml:

data: {{.Values.data | quote}}

chart/values.yaml:

data: {}

values.yaml:

data:
  foo: bar
  baz: ~

With helm v4

$ helm version
version.BuildInfo{Version:"v4.0.2", GitCommit:"94659f25033af6eb43fc186c24e6c07b1091800b", GitTreeState:"clean", GoVersion:"go1.25.4", KubeClientVersion:"v1.34"}
$ helm template chart --values values.yaml
---
# Source: foo/templates/foo.yaml
data: "map[foo:bar]"

With helm v3:

$ helm version
version.BuildInfo{Version:"v3.19.3", GitCommit:"0707f566a3f4ced24009ef14d67fe0ce69db4be9", GitTreeState:"clean", GoVersion:"go1.24.10"}
$ helm template chart --values values.yaml
---
# Source: chart/templates/foo.yaml
data: "map[baz:<nil> foo:bar]"

With an edited chart/values.yaml file

chart/values.yaml:

data: ~

With helm v4

$ helm version
version.BuildInfo{Version:"v4.0.2", GitCommit:"94659f25033af6eb43fc186c24e6c07b1091800b", GitTreeState:"clean", GoVersion:"go1.25.4", KubeClientVersion:"v1.34"}
$ helm template chart --values values.yaml
---
# Source: chart/templates/foo.yaml
data: "map[baz:<nil> foo:bar]"

Helm version

Details
$ helm version
version.BuildInfo{Version:"v4.0.2", GitCommit:"94659f25033af6eb43fc186c24e6c07b1091800b", GitTreeState:"clean", GoVersion:"go1.25.4", KubeClientVersion:"v1.34"}

Kubernetes version

Details
$ kubectl version
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions