Skip to content

Removing subchart value via override results in warning #31118

Description

@bpfoster

What happened?

If I have a chart ("Parent Chart"), which has a dependency on another chart ("Child Chart"), and I define some a dictionary value for Child Chart in Parent Chart's values.yaml, if I then attempt to remove this dictionary value (by setting to null) will result in 2 (duplicate) warnings.

For example, if I define the resources for the Child chart in Parent's values.yaml:

child-chart:
  resources:
    limits:
      cpu: 100m
      memory: 128Mi
    requests:
      cpu: 100m
      memory: 128Mi

If I then try to remove the resouces, e.g. via --set child-chart.resources=null, the following warnings are reported:

coalesce.go:298: warning: cannot overwrite table with non table for subchart-test.child-chart.resources (map[limits:map[cpu:100m memory:128Mi] requests:map[cpu:100m memory:128Mi]])
coalesce.go:298: warning: cannot overwrite table with non table for subchart-test.child-chart.resources (map[limits:map[cpu:100m memory:128Mi] requests:map[cpu:100m memory:128Mi]])

The same errors occur if the removal is done via a 2nd values file (--values values.yaml,values-override.yaml).

The end result is as expected (the Child Chart does not have resource limits), but a sufficiently large parent chart can result in a lot of these warnings.

Interestingly, if you take the sub-chart out of the equation, and attempt to do the same on the parent chart, no warnings are logged - this only occurs when doing it on a child chart.

What did you expect to happen?

No warning logged

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

  1. Check out the example chart at https://github.com/bpfoster/helm-subchart-warning-example
  2. Run helm template --set child-chart.resources=null --set resources=null .
  3. Observe warnings on child-chart:
coalesce.go:298: warning: cannot overwrite table with non table for parent-chart.child-chart.resources (map[limits:map[cpu:100m memory:128Mi] requests:map[cpu:100m memory:128Mi]])
coalesce.go:298: warning: cannot overwrite table with non table for parent-chart.child-chart.resources (map[limits:map[cpu:100m memory:128Mi] requests:map[cpu:100m memory:128Mi]])

Helm version

Details ```console $ helm version version.BuildInfo{Version:"v3.18.4", GitCommit:"d80839cf37d860c8aa9a0503fe463278f26cd5e2", GitTreeState:"clean", GoVersion:"go1.24.4"} ```

Kubernetes version

Details
$ kubectl version
Client Version: v1.32.2
Kustomize Version: v5.5.0
Server Version: v1.26.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugCategorizes issue or PR as related to a bug.

    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