helm: Nested `null` values don't remove keys as expected
https://github.com/helm/helm/pull/2648 allows for deletion of keys by setting null values in a values.yaml file. However it doesn’t work for nested values, e.g.:
web:
livenessProbe:
httpGet: null
exec:
command:
- curl
- -f
- http://localhost:8080/api/v1/info
Will not remove web.livenessProbe.httpGet from the original values, rather it just overrides the value with null and prints the warning:
2019/01/18 11:30:07 Warning: Merging destination map for chart 'concourse'. Cannot overwrite table item 'httpGet', with non table value: map[path:/api/v1/info port:atc]
Ironically, above is a small variant on the example given in the docs, which I’m pretty sure does not actually do what it claims to: https://docs.helm.sh/chart_template_guide/#deleting-a-default-key
I suspect that since the template rendering doesn’t seem to differentiate much between a null value and a value not being specified, that this warnings are being ignored and not having much effect.
Output of helm version:
Client: &version.Version{SemVer:"v2.12.1", GitCommit:"02a47c7249b1fc6d8fd3b94e6b4babf9d818144e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.1", GitCommit:"02a47c7249b1fc6d8fd3b94e6b4babf9d818144e", GitTreeState:"clean"}
Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.5-eks-6bad6d", GitCommit:"6bad6d9c768dc0864dab48a11653aa53b5a47043", GitTreeState:"clean", BuildDate:"2018-12-06T23:13:14Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Cloud Provider/Platform (AKS, GKE, Minikube etc.):
EKS
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 48 (9 by maintainers)
Commits related to this issue
- Update Helm tiller version This isn't the most recent version available (2.14.3). This version has a bug handling null Chart values https://github.com/helm/helm/issues/5184 which is a regression. We ... — committed to publicissapient-france/xebikart-infra by bartr0n 5 years ago
- K8S-1253: Adds note regarding bucket override Default bucket is not always desired when providing external bucket overrides. While it is possible to set default bucket to null, the chart creation sti... — committed to couchbase-partners/helm-charts by tahmmee 4 years ago
- K8S-1253: Allow deletion of default bucket Default bucket is not always desired when providing external bucket overrides. While it is possible to set default bucket to null, the chart creation still ... — committed to couchbase-partners/helm-charts by tahmmee 4 years ago
- removing the memory utilization default There are issues in helm3 where overriding nil does not always work. https://github.com/helm/helm/issues/5184 Memory default value of 50 percent gets applied ... — committed to anujga/ingress-nginx by anujga 4 years ago
Still exists in v3.9.2
Still exists in 3.11.1 Reproducible only with subcharts
We also hit this issue (similar to one described by @vbuciuc) with not working “null” for values override when subchart is listed as a dependency in requirements.yaml with 3.2.x. Previous versions (3.1.x) work as expected.
Raised #9136
I am experiencing the same problem with 3.4.2 when using subcharts (as described by @BohdanKalytka above). In my case I want to overwrite the securityContext when using the ElasticSearch helm chart in an OpenShift cluster. Is this issue going to be reopened, or should we create a new one?
Hi,
I’m using helm
2.15.0and I’ve still met this issue.Given a subchart with values:
Where the values are used with
toYamlAnd in a parent chart values:
Then the actual output is:
While it should have been:
The issue is still present in 3.4.2, but only in certain situations. I have a chart with multiple sub-charts. When putting default into sub chart values
nulloverride does not work. If you move the same values into parent chart values it works as expected. This is reproducible only with sub-charts. When you put it in a single (flat) chart everything works fine.After moving from helm v2.16.1 to v3.0.2. I have had this issue with annoations unsetting and cpu limits.
I have ran into the exact same issue using
3.0.1, it might be good to reopen this issue ?Still exist in
Can someone reopen the issue and fix it please ?
I just encounter this issue in
2.14.1and3.0.2. Any update on this?still exists in 3.12.3
@bacongobbler @technosophos I’m running into this issue as well with Helm
3.3.4, can you please re-open;I can confirm that it worked in
3.1.2and it stopped working after3.2.xas @paleg mentions. For now, it appears that @tuzla0autopilot4 's workaround of setting it to a non-map value likefalsewill produce the intended behavior but does give output warnings when that is done.Still seeing this problem with helm 2.16.3 but only when there’s a requirements.yaml listing the subchart as dependency.
boo is the subchart and foo is the parent chart:
Both charts here:
helm_5184.zip
In fact, I just upgraded 2.14.0 => 2.14.2. Not only does the
nulled key still exist, but it also contains the previous value. The previous behavior just made it null, so I believe this has actually regressed.I’m also encountering this exact issue with the filebeat chart.
@cdenneen You can get around file output specifically with
config.output.file.enabled=false.I’m encountering an issue where I want to use the new
inputskey for filebeat but cannot remove theprospectorskey.Existing values:
My override:
--set config.filebeat.prospectors=nullResult: (config is used to set a Secret value)
While I was unable to override a default subcharted value with
foo: nil, I was able to override withfoo: "".Please give #7743 a try. It looks like the commits made to Helm 2 were not ported over to Helm 3, which is why many users would be seeing this behaviour over there.
I have set values to null (and left them null in my values files) and ignore the long list of table warnings which is OK for now but I’d really just like to do a one-time cleanup of the old incorrect values stored in kubernetes. Until this value deletion bug is fixed, is there a manual way to edit the values on an existing deployment with no downtime?
@bacongobbler , while I haven’t explictly tested 2.14.0, what @sgillespie matches the behaviour I referred to in https://github.com/helm/helm/issues/5184#issuecomment-517059748. Sadly I think it’s a case of the unit tests passing, but the end to end failing - as the individual components are being used in series, which makes removing a key in an earlier stage makes it have no effect in later stages (and is why the original values are coming through).
I agree it’s a regression, though backing it out is also a regression for anyone relying on the new behaviour.
I’ve had a quick go at a relatively minor patch which I think will reduce the impact (and fixes the test I added above) in #6146 - I’m sorry we got this wrong the in last attempt.
stable/filebeat
With
nullornilI’m seeing the same thing… the key isn’t removed… it’s overwritten asnull/nilbut not removed and when you are replacing it with different key it causes problem:or
or
pod errors as:
repro: pyroscope-folder.zip fsGroup and runAsUser null values are not removed
Running into the same issue with
livenessandreadinessprobes. Deleting Default Key from the template guide does not work.This might’ve been fixed in https://github.com/helm/helm/pull/6080. That PR fixes the case where coalesceDeps is called twice. Can someone confirm with master?
If so, can #6146 be closed, or is it attempting to fix a separate issue? I’m trying to grasp my head around the problem space here but it’s unclear what these PRs are attempting to solve. Sorry.