Skip to content

Could not delete default keys from subcharts if subchart is defined in dependencies #9027

@jkroepke

Description

@jkroepke

Hi,

looking at docs https://helm.sh/docs/chart_template_guide/values_files/#deleting-a-default-key I'm able to remove keys from default values located in subcharts:

values.yaml:

# demo/values.yaml:
global:
  hash:
    key1: null
    key2: null
    key3: 13

subchart:
  hash:
    key1: null
    key2: null
    key3: 13
---
# demo/charts/subchart/values.yaml:
global:
  hash:
    key1: 1
    key2: 2
    key3: 3
    key4: 4
    key5: 5
    key6: 6

hash:
  key1: 1
  key2: 2
  key3: 3
  key4: 4
  key5: 5
  key6: 6

Output:

jkr@joe-nb demo % 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 If I add:

dependencies:
  - name: subchart
    version: 0.1.0

to the main Chart.yaml the behavior changes:

jkr@joe-nb demo % helm template .
---
# Source: demo/charts/subchart/templates/values.yaml
global:
  hash:
    key1: 1
    key2: 2
    key3: 13
    key4: 4
    key5: 5
    key6: 6
hash:
  key1: 1
  key2: 2
  key3: 13
  key4: 4
  key5: 5
  key6: 6

The merge of values is still working while removing key isn't working.
This bug exists on helm2 w/ requirements.yaml, too. Just for notice.

Output of helm version:

jkr@joe-nb demo % helm version  
version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"dirty", GoVersion:"go1.15.3"}

Demo: chart.tar.gz (wrong file extension, its an uncompressed tar)

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