helm: helm CLI incorrectly splits on commas even when quoted
When using the helm command and overriding values using --set, if the key value contains a comma, the value is halted there.
I’m assuming the entire argument is being split on commas, regardless of escaping or quotes.
Testing:
$ helm install kubernetes-charts/mysql --set mysqlUser="test_mysqluser,blah,dee,dah" --dry-run --debug | grep test_mysqluser
RETURNS
value: "test_mysqluser"
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 19 (7 by maintainers)
Commits related to this issue
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to technosophos/k8s-helm by technosophos 8 years ago
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to technosophos/k8s-helm by technosophos 8 years ago
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to technosophos/k8s-helm by technosophos 8 years ago
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to technosophos/k8s-helm by technosophos 8 years ago
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to technosophos/k8s-helm by technosophos 8 years ago
- fix(helm): improve --set parser This replaces the old set parser with a brand new one. This also changes the internal algorithm from duplicating YAML to merging YAML, which might solve a problem one ... — committed to helm/helm by technosophos 8 years ago
- Use ghodss/yaml for yaml marshaling & unmarshaling in template (#1556) Fixes #1555 Co-authored-by: Yoann Ciabaud <yoann@linxo.com> Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com> — committed to Nordix/helm by yciabaud 4 years ago
For anyone else coming up on this issue, there is a workaround by escaping the commas with a backslash:
https://github.com/kubernetes/helm/blob/master/docs/using_helm.md#the-format-and-limitations-of---set
Just as a side note, we still believe that this a very unintuitive behaviour that needs a fix. Our use case right now was LDAP credentials, which naturally contain commas, but it also seems very problematic for autogenerated passwords, that might accidentally contain a comma.
Although I couldn’t find any mention or example in the document, reading the improved parsing code (thanks @technosophos!), you can ‘escape’ a comma, e.g.
pass\,wordand bypass the splitting. So--set 'my.password=pass\,word'will work until the comma splitting can be deprecated.This is not a good user experience. For an escape, I had to do something like this:
helm already breaks compatibility with the tiller, just bump major and fix this
got bitten by this too
Thanks a lot. I’ve escaped comas and this helped. It would be too harsh in my opinion to create a separate values file just for one parameter.
But I will be glad if someone will add the mention of this behavior to docs. Because I didn’t find specific info on this.
Just been banging my head against this with helm 2.8.2. You can now have multiple ‘–set’ arguments, so the old comma syntax can (or should) be deprecated. It was always clunky and I stopped using it as soon as multiple ‘–set’ worked. However it is still the case that as soon as I have a comma in the value helm splits it and borks the deployment. No amount of quoting seems to work around it.
Could we ensure we deprecate the commas (maybe with a warning message) in 2.9.x, and not include it in 3.x?
Instead of writing a better parser for handling the splitting accounting for quotes why not allow to specify
--setmultiple times? I realise this is a breaking change but would be cleaner and easier to maintain IMO.