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
{{ message }}
Repository navigation
helm CLI incorrectly splits on commas even when quoted #1556
@aegixx That is the correct location. That whole parser needs to be rewritten to be more robust. There's another issue with dots being unescapable. A PR would be awesome.
Instead of writing a better parser for handling the splitting accounting for quotes why not allow to specify --set multiple times? I realise this is a breaking change but would be cleaner and easier to maintain IMO.
Reacted by Joaquin Menchaca, Tucker Pelletier and Andy Gnias
Unfortunately this won't help for my issue. I'm setting environment variables that have a longer string that just happens to contain a comma. Multiple sets won't help with that specific issue.
--Bryan
On Fri, Nov 18, 2016 at 5:40 PM -0600, "Fabian Ruff" [email protected] wrote:
Instead of writing a better parser for handling the splitting accounting for quotes why not allow to specify --set multiple times? I realise this is a breaking change but would be cleaner and easier to maintain IMO.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@aegixx It would if splitting multiple values by commas would be removed completly in favour of specifying --set multiple times. That's what I meant. Looking at the other issues related to parsing the --set flag I think there are two options:
Improve the parser considerably. I think that basically means implementing a "real" parser, something like LALR(1). Which also requires creating a lexer. I think working just with string splitting and/or regex matching is difficult to get right when an arbitrary amount for values is supported.
Reduce the complexity by limiting the scope of --set to one value and just get the parsing of types and keys correct with regexes.
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?
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\,word and bypass the splitting. So --set 'my.password=pass\,word' will work until the comma splitting can be deprecated.
Reacted by Simon Kerler, Sergei Maximov, Maxime, Well, Caner, Eddy Fabery, Tommy Falgout, Jo, Dário, Dan Lee and 9 more
About the comma-separated key value pairs, having the option to turn comma-separation off would be nice, as we need to specify strings with multiple commas in them (eg. mongo connection strings), and escaping these from within shell scripts/CD tooling/environment variables can be a pain.
This is not a good user experience. For an escape, I had to do something like this:
helm install dev dgraph/dgraph \
--set alpha.extraEnvs[0].name=DGRAPH_ALPHA_WHITELIST \
--set alpha.extraEnvs[0].value='10.0.0.0\/8\,172.16.0.0/12\,192.168.0.0\/16'
Reacted by Ahmadali Shafiee, mgudesblatart, Chris Bargmann, FilBot3, Gabriel de Oliveira Barbosa, Harrison Powers, Ranjith KA, Lokman Rahmani, Christian Karlsen and very-doge-wow
Reacted by FilBot3
Reacted by FilBot3, Ranjith KA, James McBride and Matt Fozard
This is not a good user experience. For an escape, I had to do something like this:
helm install dev dgraph/dgraph \
--set alpha.extraEnvs[0].name=DGRAPH_ALPHA_WHITELIST \
--set alpha.extraEnvs[0].value='10.0.0.0\/8\,172.16.0.0/12\,192.168.0.0\/16'
Just spent 4 days beating my head against the desk to find this. I will try this next. I ended up writing out to a temp file then telling helm to use a second --values file. This does seem like it's still an issue.
Not quite sure how Nordix@54eb73b is supposed to fix this and I still encounter this issue when using helm v3.14.2.
Is it just me?
No, it’s not just you. I’ve just spent good few hours pulling my hair out in attempt to troubleshoot this. Everything worked in dev environment where I deploy using Docker Compose, but once I’ve pushed to Test AKS using helm… it stopped. Thought there was a problem with connectivity to LDAP server but it was a coma in a user DN. omg I can’t believe it
I just spent a while fighting this one myself, the best solution I found that I've not seen suggested yet is to echo out the YAML values and pipe it into Helm, e.g.
Activity
rimusz commentedon Nov 16, 2016
I can confirm got cut by this bug yesterday too
aegixx commentedon Nov 16, 2016
If someone can point me in the right direction (where in the code is this handled?) - I'll take a look at creating a PR. To me, it looks like an issue @ https://github.com/kubernetes/helm/blob/master/cmd/helm/install.go#L268
If someone can confirm if I'm at least thinking correctly.
technosophos commentedon Nov 16, 2016
@aegixx That is the correct location. That whole parser needs to be rewritten to be more robust. There's another issue with dots being unescapable. A PR would be awesome.
databus23 commentedon Nov 18, 2016
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.aegixx commentedon Nov 19, 2016
Unfortunately this won't help for my issue. I'm setting environment variables that have a longer string that just happens to contain a comma. Multiple sets won't help with that specific issue.
--Bryan
On Fri, Nov 18, 2016 at 5:40 PM -0600, "Fabian Ruff" [email protected] wrote:
Instead of writing a better parser for handling the splitting accounting for quotes why not allow to specify --set multiple times? I realise this is a breaking change but would be cleaner and easier to maintain IMO.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
databus23 commentedon Nov 20, 2016
@aegixx It would if splitting multiple values by commas would be removed completly in favour of specifying
--setmultiple times. That's what I meant. Looking at the other issues related to parsing the--setflag I think there are two options:--setto one value and just get the parsing of types and keys correct with regexes.technosophos commentedon Nov 21, 2016
The unfortunate thing, @databus23, is that we can't break backward compatibility, and Option 2 would break the existing behavior.
fix(helm): improve --set parser
fix(helm): improve --set parser
fix(helm): improve --set parser
fix(helm): improve --set parser
fix(helm): improve --set parser
fix(helm): improve --set parser
2 remaining items
whereisaaron commentedon May 31, 2018
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?
whereisaaron commentedon May 31, 2018
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.kvolkovich-sc commentedon Jul 31, 2018
@dsample®
rcjsuen commentedon Dec 9, 2018
Trying to define the cron schedule on the command line but this is making things more difficult than it needs to be. :(
darkn3rd commentedon Dec 22, 2020
This is not a good user experience. For an escape, I had to do something like this:
helm install dev dgraph/dgraph \ --set alpha.extraEnvs[0].name=DGRAPH_ALPHA_WHITELIST \ --set alpha.extraEnvs[0].value='10.0.0.0\/8\,172.16.0.0/12\,192.168.0.0\/16'FilBot3 commentedon Sep 27, 2021
Just spent 4 days beating my head against the desk to find this. I will try this next. I ended up writing out to a temp file then telling helm to use a second
--valuesfile. This does seem like it's still an issue.zerthimon commentedon Oct 8, 2021
got bitten by this too
vpapidokha commentedon Mar 23, 2022
Still in the same situation.
FilBot3 commentedon Mar 23, 2022
you should put your contents into a YAML file and provide it as an extra --values file. See: #1556 (comment)
vpapidokha commentedon Mar 24, 2022
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.
Use ghodss/yaml for yaml marshaling & unmarshaling in template (helm#…
very-doge-wow commentedon Mar 8, 2024
Not quite sure how Nordix@54eb73b is supposed to fix this and I still encounter this issue when using helm v3.14.2.
Is it just me?
Yakuza-UA commentedon Apr 23, 2024
No, it’s not just you. I’ve just spent good few hours pulling my hair out in attempt to troubleshoot this. Everything worked in dev environment where I deploy using Docker Compose, but once I’ve pushed to Test AKS using helm… it stopped. Thought there was a problem with connectivity to LDAP server but it was a coma in a user DN. omg I can’t believe it
danrspencer commentedon Aug 12, 2024
I just spent a while fighting this one myself, the best solution I found that I've not seen suggested yet is to echo out the YAML values and pipe it into Helm, e.g.
Annoying for setting a single values but if you're setting lots it's probably actually clearer than many
--setflags.chore: escape commas in PGPASSWORD in helm install