-
Notifications
You must be signed in to change notification settings - Fork 13
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
Quoted values transformed to scientific notation number #262
Comments
Hi @seniorquico, thank you for using HULL and your report! Unfortunately you have hit a hornets nest here. This is a general Helm problem (or I suppose more of a Go problem) and not specific to HULL, It pops up whenever you have an integer number which is greater than 1.000.000 wrapped in a string. Internally it converts the big int into a float64 and produces the dreaded scientific notation. So in your case - if the stars align badly - it is the commit hash being all numbers. There are many threads about it, this matches your use case I think exactly. But there are lots of other reports of this such as this , this and this with the mother of all threads on the subject being this one having a display of 93 comments (think it is way more though) and 60 users involved. It started in 2016 and is still - from my point of view - open. There are a couple of workarounds mentioned here which may be applicable in your case, Actually I have hit this too at some point when trying to reference a large number > 1.000.000 in a chart and putting it into an env var. I was similarily surprised to find this is a well known issue and yet unresolved in a proper fashion. When I found it I tried to do some magic in the inner code of HULL to get around it but it seemed hard to impossible since basically the very last I will try to come up with a suggestion of applying one of the workarounds to your nice example, thanks for that. Or maybe I take another stab at it to solve it in an acceptable way in HULL. Even though it is not HULL's problem I would certainly like HULL to not stumble over it and offer some advantage over plain Helm if possible. |
After a second deeper look it seems there is not much that can be done reasonably in HULL itself to overcome the issue(s). The main somewhat related problems seem to be:
Looking at 1., the original type is already lost when starting to work with the values so it is impossible to automatically apply workarounds to treat everything correctly in the process. Something like The simple and convenient - yet mostly sufficient - The following is tested with
The above mentioned and in my opinion best workarounds I took from here. To conclude, I think you should try using the following code to cover all bases since the commit hash may both resemble large integers > 1.000.000 or a general number in scientific notation:
Sorry it is that ugly and unintuitive, can't do much about the original problem :( Hope what I wrote above is correct and proposed solution works for you, if not let me know! |
@seniorquico Happy new year to you ;) Are you satisfied with the explanations above? If so let me know, if not please also let me know. Will leave this open for a couple of days hoping to hear from you before closing, Thanks! |
Yes, I understand the limitations. I'll give this workaround a try the next time this problem occurs. Thanks for the follow-up! |
I'm trying to build a set of deployments based on Hull and ran into an interesting YAML quoting/number formatting issue... I defined a variable
tag
that I reuse in several places. I populate it with a short Git revision hash. Here's an abbreviated version of the config:However, when I render using
helm template
and attempt to deploy it via Argo CD (which also callshelm template
), I get this (abbreviated, again):As shown above, I explicitly quoted the tag value, i.e.
tag: "3964137"
, and I tried explicitly quoting the shortcut, e.g.tag: "_HT*hull.config.specific.tag"
. It doesn't seem to have any impact, though.Is there a way to get my variable value respected as a string and not turned into scientific notation?
The text was updated successfully, but these errors were encountered: