You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the introduction of deep merging (#1620), it's now not possible to remove keys from values.yml entirely.
For example, the telegraf values has a default entry for single.config.inputs.influxdb (see: L340). There's no way to completely remove this key through --set or a override file.
single:
config:
inputs:
influxdb: null # or something?
Reacted by Igor Katson, Marat Surmashev, Feron Valentin, ichtestemalwieder, Aidan, Danny Kulchinsky, Tianhe Zhang, Dmytro Buryak, An Nguyen, Hiroshi Muraoka and 2 more
A flag to indicate the values you're supplying replace the values from the chart. helm install -f my-values.yml --overwrite
A special value in the yaml to indicate not to merge, perhaps a null. e.g. Null means delete this key
Meta: the reason this is a problem is because Telegraf doesn't have an explicit enabled property you can set, so the presence of a value is significant.
We could work around this by adding our own enabled key under influxdb, and check for the presence that in the templating and not write out the node; but this puts the onus on each chart to get it right.
More meta: I've also been thinking about whether we should be trying to generate config files from YAML in the first place. Several charts (the Influx stack in particular) allow you to specify configs in YAML which get translated into TOML, this translation is quite complicated and I suspect we're losing some information in translation. Each chart is having to do this itself. It might be better to just not try to do this at all, have the ConfigMap contain non-generated TOML which you can just pass your own in wholesale. Most of the time I already have a config file I want to use, and translating it to YAML is arduous (though I appreciate being able to abstract away complicated configs).
I wouldn't be opposed at all to an --overwrite flag. That makes sense.
Some work did make it into Helm 2.2.0 which will allow subcharts to be switched on and off based on conditions. But it will likely take the charts repository a while to catch up on those.
Hey guys, just coming to this now. We were just brainstorming about this problem in Slack Today. And just as I was about to create an issue, I looked and found this one 😄
So I prefer the null option, over --overwrite, because that could change more than we need. The immediate problem I see with an --overwrite flag is that would change the deep nesting behavior of all the keys/values from #1656 (helm install some/chart -f values1.yaml -f values2.yaml --set foo.bar=baz. I would think we want to be able to target specific keys, otherwise lots of breakage may happen. Whereas we could just add one check for a null value during the Helm deep nesting logic, and in that case nix the key.
Reacted by Josh Hull, Fabio Todaro and Frédéric Barrière
I also like the null option and using it with helm init --set would allow advanced users to completely remove keys (e.g. the default nodeSelector that specifies linux) and have more control of the Tiller Deployment manifest.
@scottrigby So I was looking at the code as it stands without your PR. It looks like ~ indicates null in YAML. I was able to overwrite any key using that notation. However, with that said, it won't actually delete the key, it will just set its value to null. So I think your PR is a better option because it actually deletes the key from the map
Activity
technosophos commentedon Feb 17, 2017
Yeah, this appears to be true. Any suggestions about how we might support that?
jagregory commentedon Feb 17, 2017
A few options come to mind:
helm install -f my-values.yml --overwritenull. e.g. Null means delete this keyMeta: the reason this is a problem is because Telegraf doesn't have an explicit
enabledproperty you can set, so the presence of a value is significant.We could work around this by adding our own
enabledkey underinfluxdb, and check for the presence that in the templating and not write out the node; but this puts the onus on each chart to get it right.More meta: I've also been thinking about whether we should be trying to generate config files from YAML in the first place. Several charts (the Influx stack in particular) allow you to specify configs in YAML which get translated into TOML, this translation is quite complicated and I suspect we're losing some information in translation. Each chart is having to do this itself. It might be better to just not try to do this at all, have the ConfigMap contain non-generated TOML which you can just pass your own in wholesale. Most of the time I already have a config file I want to use, and translating it to YAML is arduous (though I appreciate being able to abstract away complicated configs).
jagregory commentedon Feb 17, 2017
Prior art for my last little ramble: grafana.ini
technosophos commentedon Feb 17, 2017
I wouldn't be opposed at all to an
--overwriteflag. That makes sense.Some work did make it into Helm 2.2.0 which will allow subcharts to be switched on and off based on conditions. But it will likely take the charts repository a while to catch up on those.
scottrigby commentedon Jul 5, 2017
Hey guys, just coming to this now. We were just brainstorming about this problem in Slack Today. And just as I was about to create an issue, I looked and found this one 😄
So I prefer the
nulloption, over--overwrite, because that could change more than we need. The immediate problem I see with an--overwriteflag is that would change the deep nesting behavior of all the keys/values from #1656 (helm install some/chart -f values1.yaml -f values2.yaml --set foo.bar=baz. I would think we want to be able to target specific keys, otherwise lots of breakage may happen. Whereas we could just add one check for anullvalue during the Helm deep nesting logic, and in that case nix the key.jascott1 commentedon Jul 5, 2017
I also like the
nulloption and using it withhelm init --setwould allow advanced users to completely remove keys (e.g. the default nodeSelector that specifies linux) and have more control of the Tiller Deployment manifest.thomastaylor312 commentedon Jul 6, 2017
@scottrigby So I was looking at the code as it stands without your PR. It looks like
~indicatesnullin YAML. I was able to overwrite any key using that notation. However, with that said, it won't actually delete the key, it will just set its value tonull. So I think your PR is a better option because it actually deletes the key from the maptechnosophos commentedon Jul 6, 2017
Yeah, I too prefer an explicit null.
technosophos commentedon Jul 6, 2017
If ya'll agree, could we add this to 2.6 under the "stability and security" heading?
thomastaylor312 commentedon Jul 6, 2017
Yes, I agree and already labeled the PR as such 😄
thomastaylor312 commentedon Jul 7, 2017
Closed in #2648
Fix anchoreGlobal.scratchVolume
Fix anchoreGlobal.scratchVolume