Skip to content

subchart keys can not be removed by parent chart in v3.13.* when --values (-f) flag is used #12488

Closed

Description

@rptaylor

Output of helm version: version.BuildInfo{Version:"v3.13.1", GitCommit:"3547a4b5bf5edb5478ce352e18858d8a552a4110", GitTreeState:"clean", GoVersion:"go1.20.8"}

Output of kubectl version: N/A, reproducible without k8s

Cloud Provider/Platform (AKS, GKE, Minikube etc.): N/A

First off I am very excited to have a fix for #9027 , thank you for working on this!!
I seem to have found a peculiar bug though.
Following closely the reproduction steps from #9027 , I set up an environment using the same tarball:

$ mkdir demo
$ cd demo
$ wget https://github.com/helm/helm/files/5549239/chart.tar.gz
$ tar xf chart.tar.gz
$ cat Chart.yaml 
apiVersion: v2
name: demo
version: 0.1.0
dependencies:
  - name: subchart
    version: 0.1.0
$ file charts/subchart/templates/._values.yaml           #  ???? 
charts/subchart/templates/._values.yaml: AppleDouble encoded Macintosh file
$ rm charts/subchart/templates/._values.yaml

Confirm that the original issue is fixed - subchart.hash.key1 and key2 are removed since they are set to null in values.yaml

$ ~/helm-v3.13.1/helm template .
---
# Source: demo/charts/subchart/templates/values.yaml
global:
  hash:
    key3: 13
    key4: 4
    key5: 5
    key6: 6
hash:
  key3: 13
  key4: 4
  key5: 5
  key6: 6

But after hours of banging my head against the wall I eventually found that the strange issue I was seeing is apparently triggered when you use the --values command line option. Even though ./values.yaml is the real source of values being used by the above command, if you specify it with --values values.yaml the behaviour changes!

$ ~/helm-v3.13.1/helm template . --values values.yaml 
---
# Source: demo/charts/subchart/templates/values.yaml
global:
  hash:
    key3: 13
    key4: 4
    key5: 5
    key6: 6
hash:
  key1: 1
  key2: 2
  key3: 13
  key4: 4
  key5: 5
  key6: 6

Same thing if you specify an absolute path to the values.yaml file:

$ ~/helm-v3.13.1/helm template .   --values /home/fedora/demo/values.yaml

or copy it somewhere else:

$ cp values.yaml  /tmp/whatever.yaml 
$ ~/helm-v3.13.1/helm template .  --values /tmp/whatever.yaml

I found the same result with 3.13.0.

In v3.12.3 the behaviour is different but if anything more confusing:

$ ~/helm-v3.12.3/helm  template .
---
# Source: demo/charts/subchart/templates/values.yaml
global:
  hash:
    key3: 13
    key4: 4
    key5: 5
    key6: 6
hash:
  key1: 1
  key2: 2
  key3: 13
  key4: 4
  key5: 5
  key6: 6
$ ~/helm-v3.12.3/helm template . --values values.yaml
---
# Source: demo/charts/subchart/templates/values.yaml
global:
  hash:
    key1: 1
    key2: 2
    key3: 13
    key4: 4
    key5: 5
    key6: 6
hash:
  key3: 13
  key4: 4
  key5: 5
  key6: 6

Anyway surely the location of the values file and the fact that I have specified it with --values should not make any difference - only the content of that file should affect the outcome of the templating. I thought values (and values files) specified on the command line should still be the highest priority?

Activity

  1. gjenkins8 commented on Oct 13, 2023

    @gjenkins8
    Member

    3.13.1 had a fix: #12480

    Could you please retry with 3.13.1. Thanks!

  2. rptaylor commented on Oct 13, 2023

    @rptaylor
    Author

    @gjenkins8 My "Output of helm version" and reproduction steps shown here indicate that this is with helm 3.13.1. I also tried 3.13.0 with the same result. I mentioned v3.13.0 in the title since that is when the change occurred.

  3. aabouzaid commented on Oct 14, 2023

    @aabouzaid

    As mentioned in #12490, I confirm that the issue happens with Helm 3.13.0/3.13.1.

  4. gjenkins8 commented on Oct 15, 2023

    @gjenkins8
    Member

    @gjenkins8 My "Output of helm version" and reproduction steps shown here indicate that this is with helm 3.13.1. I also tried 3.13.0 with the same result. I mentioned v3.13.0 in the title since that is when the change occurred.

    Thanks. The issue title says v3.13.0, so I wanted to clarify. Lets focus on v3.13.1, given #12480

  5. changed the title [-]change in values handling with v3.13.0 when --values flag is used[/-] [+]change in values handling with v3.13.0, v3.13.1 when --values flag is used[/+] on Oct 16, 2023
  6. rptaylor commented on Oct 17, 2023

    @rptaylor
    Author

    @gjenkins8 can this be labelled as a bug rather than question/support?
    Our workflow requires specifying a values file so we can not benefit from the fixes in v3.13.0 yet. Also when you install a chart from a remote repository I think you would generally always rely on using a custom values file.

  7. changed the title [-]change in values handling with v3.13.0, v3.13.1 when --values flag is used[/-] [+]subchart keys can not be removed by parent chart in v3.13.0, v3.13.1 when --values (-f) flag is used[/+] on Oct 25, 2023
  8. rptaylor commented on Oct 30, 2023

    @rptaylor
    Author

    @gjenkins8 Could you please have another look at the labels on this issue if you have a moment?
    There have been several duplicate issues opened for this bug. It still prevents the removal of subchart keys in v3.13 from working since the --values flag is (at least I think) typically used in most situations.

  9. ReneWerner87 commented on Nov 7, 2023

    @ReneWerner87

    @gjenkins8 can confirm, problem also exists in the latest version (with Helm 3.13.0/3.13.1)

  10. changed the title [-]subchart keys can not be removed by parent chart in v3.13.0, v3.13.1 when --values (-f) flag is used[/-] [+]subchart keys can not be removed by parent chart in v3.13.* when --values (-f) flag is used[/+] on Nov 21, 2023
  11. rptaylor commented on Nov 21, 2023

    @rptaylor
    Author

    @mattfarina Could you please take a look at this? Thanks!

  12. messiahUA commented on Jan 10, 2024

    @messiahUA

    I experience this on helm v3.13.3 and hope this will be addressed sooner than later.

  13. gavin-jeong commented on Jan 19, 2024

    @gavin-jeong

    Same with v3.14.0

  14. 5 remaining items

  15. github-actions commented on Jul 20, 2024

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  16. rptaylor commented on Jul 22, 2024

    @rptaylor
    Author

    Looks like this still has not been fixed.

  17. akiyashkin-ronasit commented on Aug 20, 2024

    @akiyashkin-ronasit

    This is such a painful issue for us because of a widespread use of nodeSelector in some of the charts. Please, would anyone fix this?

  18. crumdev commented on Sep 13, 2024

    @crumdev

    Still happening

    version.BuildInfo{Version:"v3.15.1", GitCommit:"e211f2aa62992bd72586b395de50979e31231829", GitTreeState:"clean", GoVersion:"go1.22.3"}

    Have a simple dependency chart let's say mysubchart with a default array of objects:

    somekey:
    - name: value
      id: value

    then in parent values.dev.yaml passing in

    mysubchart:
      somekey:
      - name: differentValue
        id: differentValue

    but when running helm template mychart -f values.dev.yaml . It is not being overwritten.

  19. alimoezzi commented on Dec 7, 2024

    @alimoezzi

    Still relevant.

  20. alice-sawatzky commented on Mar 20, 2025

    @alice-sawatzky

    if there's a pull request to fix this issue, and the pull request is not merged, why is the issue marked as fixed?

  21. scottrigby commented on Apr 18, 2025

    @scottrigby
    Member

    if there's a pull request to fix this issue, and the pull request is not merged, why is the issue marked as fixed?

    Hi @alice-sawatzky, #12879, which fixed the issue in main, and a backport PR for v3 were both merged. This fix was released in Helm v13.7.1. See #12879 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions