helm: Could not delete default keys from subcharts if subchart is defined in dependencies
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)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 42
- Comments: 44 (2 by maintainers)
Commits related to this issue
- Fix multiple bugs in values handling First, some notes about priority and how some code flow works. For Helm handling values, the expected order of precidence is: 1. User specified values (e.g CLI) ... — committed to mattfarina/helm by mattfarina a year ago
- Fix multiple bugs in values handling First, some notes about priority and how some code flow works. For Helm handling values, the expected order of precidence is: 1. User specified values (e.g CLI) ... — committed to mattfarina/helm by mattfarina a year ago
- Fix multiple bugs in values handling First, some notes about priority and how some code flow works. For Helm handling values, the expected order of precidence is: 1. User specified values (e.g CLI) ... — committed to mattfarina/helm by mattfarina a year ago
- set limits cause i have to due to https://github.com/helm/helm/issues/9027 — committed to MattJeanes/Abyss-Infrastructure by MattJeanes a year ago
- Fix multiple bugs in values handling First, some notes about priority and how some code flow works. For Helm handling values, the expected order of precidence is: 1. User specified values (e.g CLI) ... — committed to mattfarina/helm by mattfarina a year ago
- Fix multiple bugs in values handling First, some notes about priority and how some code flow works. For Helm handling values, the expected order of precidence is: 1. User specified values (e.g CLI) ... — committed to wahabmk/helm by mattfarina a year ago
Two years after this seemingly simple bug report was originally opened, we are still waiting on a fix and https://github.com/helm/helm/pull/11440 now appears to be stalled.
This issue is such pain in the ass. Please fix it asap.
Running into this issue as well, we deploy all our stuff with ArgoCD via helm dependencies and this is really makes some deployments impossible
quick and dirty workaround until #11440 gets merged: run helm with
Hopefully it’s obvious why this is a pretty risky option; since it’s just a regex and not actually parsing the yaml, it will also affect things like block-formatted string values with lines that happen to end with
: null
(for example, a configmap containing a yaml file that is supposed to have a null value in it). If this is your use case, you could probably put together an appropriateyq
command to use instead of grep. You can also reduce the risk by narrowing down the expression, for example if you’re just getting bitten by this bug because of nullresources.limits.cpu
values, you could usecpu: null$
as the expression instead.Note to maintainers: please don’t take the existence of workarounds like this as evidence that this is not a high-priority issue! If anything, the relative jankiness of workarounds users are resorting to should serve to emphasize the importance of fixing this.
Using Helm
version.BuildInfo{Version:"v3.10.2", GitCommit:"50f003e5ee8704ec937a756c646870227d7c8b58", GitTreeState:"clean", GoVersion:"go1.18.8"}
and the Traefik20.3.0
chart as a dependency. I can’t removetraefik.updateStrategy.rollingUpdate
when settingtype
toRecreate
. The Helm doc does not suggest that this is not possible…Pain in the ass for me as well 😦
No, the behaviour for -f and --values is the same.
Here is my summary of some tests I’ve made. Will these cases be treated differently when #11440 or #12162 is merged? Tested with helm 3.11.3.
global
means the value is under theglobal
i helm values. The number in the key is how deep the key is nested:myKey1
,myKey2
etc.-f values.yaml
-f values.yaml
-f values.yaml
-f values.yaml
values.yaml
main.yaml
/remove-lifecycle stale
same issue on my side too (also via Argo CD)
Struggling on the same issue with kube-prometheus-stack subcharts
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.