Skip to content

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

Closed

Description

@databus23

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.

Activity

  1. 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 [/+] on Nov 16, 2016
  2. jchauncey commented on Nov 16, 2016

    @jchauncey

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

  3. databus23 commented on Nov 16, 2016

    @databus23
    ContributorAuthor

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

  4. added this to the 2.0.1 milestone on Nov 16, 2016
  5. technosophos commented on Nov 16, 2016

    @technosophos
    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
  6. aegixx commented on Nov 16, 2016

    @aegixx

    Related to #1556

  7. TerraTech commented on Nov 26, 2016

    @TerraTech

    @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.

  8. peay commented on Mar 1, 2017

    @peay
    Contributor

    @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.

  9. technosophos commented on Mar 1, 2017

    @technosophos
    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.

  10. peay commented on Mar 1, 2017

    @peay
    Contributor

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

  11. arturo-c commented on Mar 7, 2018

    @arturo-c

    @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

  12. todaywasawesome commented on Jun 20, 2018

    @todaywasawesome

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions