Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impossible to set string values on the command line that look like floats #1558

Closed
databus23 opened this issue Nov 16, 2016 · 10 comments
Closed
Milestone

Comments

@databus23
Copy link
Contributor

databus23 commented Nov 16, 2016

I have a template which contains this:

{{.Values.image.repository}}:{{.Values.image.tag}}

trying to do helm install --set image.tag=20161115.1 yields this:

hub.global.cloud.sap/monsoon/monsoon-dashboard:2.0161116e+07

trying to do helm install --set 'image.tag="20161115.1"' yields this:

hub.global.cloud.sap/monsoon/monsoon-dashboard:"20161115.1"

I think the problem lies in cmd.helm.typedVal.

Seems to to me as it stands passing a string that looks like a float via cli args is not possible atm.

@databus23 databus23 changed the title impossible to set string values on the commandline that look like floats impossible to set string values on the command line that look like floats Nov 16, 2016
@jchauncey
Copy link

Have you tried doing that with no quotes around image.tag? so --set image.tag=20161115.1

@databus23
Copy link
Contributor Author

@jchauncey yes, see above. That's were it all started.

@technosophos technosophos added this to the 2.0.1 milestone Nov 16, 2016
@technosophos
Copy link
Member

I particularly "like" how it helpfully converts the presumed float to scientific notation!

@databus23 does it make the most sense to you if we simply added support for quotes? Other options would be:

  • Revert to treating all --set params to strings (which caused problems for some)
  • Allow explicit casts (--set foo=string(1.23))
  • Create a bunch of flags for different primitives: --setInt, --setString, etc

@aegixx
Copy link

aegixx commented Nov 16, 2016

Related to #1556

@TerraTech
Copy link

TerraTech commented Nov 26, 2016

@technosophos I ran into this yesterday by trying to: helm install foo --set mlabel="05"
I wanted "05" to be a string and not a float.

My +1 would be for >> Allow explicit casts (--set foo=string(1.23))

I think adding a bunch of different primitives is bloated solution for something that would be rarely needed. Having the ability to reach into the toolbox and using an inline cast would provide a streamlined interface and grant access to the full range of types.

@peay
Copy link
Contributor

peay commented Mar 1, 2017

@technosophos can you say a few words about what is the final solution to this issue implemented by #1576? I've been having the same issue in v2.1.0.

@technosophos
Copy link
Member

@peay we are still tracking the float issue in #1707. There are a few hacky work-arounds there, but we don't have a final solution yet.

@peay
Copy link
Contributor

peay commented Mar 1, 2017

Ah, hadn't found this one. The replace workaround should do the job, thanks!

@arturo-c
Copy link

arturo-c commented Mar 7, 2018

@technosophos I created a pr for this issue #3599, I went with option 3, let me know if its a viable solution. Went with --set-string, but I can easily change it to --setString if thats more appropriate

@todaywasawesome
Copy link

This is still a real issue that should be resolved. For anyone looking for a workaround, I'm adding letters to any character. In my use case, instead of referencing images based on their commit SHA, I'm adding their branch name. So instead of 5937127 I do master-5937127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants