-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
--set parses number only values as float64 #1707
Comments
Does it work differently if you do |
Thanks to @chancez we know the exact problem: During the conversions to and from JSON done by |
I've been bitten by the same problem. The way of getting over the hump (or the bug) is to do this:
|
Another workaround we have used is to do stuff like this:
Then in the template:
|
Yuck! 😷 |
This is a heck of a pain, and @ipedrazas' workaround doesn't seem to work for me, or any other combination of quoting/escaping I've tried. I'm not quite willing yet to swallow my pride and try @technosophos' ugly hack... For now I'm hacking around this by expanding my deploy script to write the data as yaml to a temporary file and use that as a |
I'm facing the same issue from time to time for the image tag. |
In my case, seeing this below on $ kubetctl describe po msj-treasure-map-msj-treasure-map-192172122-dnb80
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 1m default-scheduler Successfully assigned msj-treasure-map-msj-treasure-map-192172122-dnb80 to ip-10-253-13-113.ec2.internal
Warning InspectFailed 15s (x9 over 1m) kubelet, ip-10-253-13-113.ec2.internal Failed to apply default image tag "596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-uwsgi:5.997578e+06": couldn't parse image reference "596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-uwsgi:5.997578e+06": invalid reference format
Warning InspectFailed 15s (x9 over 1m) kubelet, ip-10-253-13-113.ec2.internal Failed to apply default image tag "596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-nginx:5.997578e+06": couldn't parse image reference "596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-nginx:5.997578e+06": invalid reference format
Warning FailedSync 15s (x9 over 1m) kubelet, ip-10-253-13-113.ec2.internal Error syncing pod, skipping: [failed to "StartContainer" for "msj-treasure-map-uwsgi" with InvalidImageName: "Failed to apply default image tag \"596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-uwsgi:5.997578e+06\": couldn't parse image reference \"596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-uwsgi:5.997578e+06\": invalid reference format"
, failed to "StartContainer" for "msj-treasure-map-nginx" with InvalidImageName: "Failed to apply default image tag \"596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-nginx:5.997578e+06\": couldn't parse image reference \"596297932419.dkr.ecr.us-east-1.amazonaws.com/msj-trmap-nginx:5.997578e+06\": invalid reference format" $ helm version
Client: &version.Version{SemVer:"v2.5.1", GitCommit:"7cf31e8d9a026287041bae077b09165be247ae66", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.5.1", GitCommit:"7cf31e8d9a026287041bae077b09165be247ae66", GitTreeState:"clean"} |
I am also experiencing the same problem on helm 2.6.2.
|
Stripping YAML down to JSON removes a lot of information, most type related. Means you can't type check values pre-deploy. I guess this can be resolved by moving to a different yaml library. Maybe this one: https://github.com/go-yaml |
This is a workaround for bug helm/helm#1707
This is a workaround for bug helm/helm#1707
@joejulian I'm having this issue right now with I'm not seeing how its resolved or a workaround using |
I'm having this exact same issue using My I get the following result: Happy to create a new issue for this as this is an old thread, but if I do, can it actually be fixed?? I've skirted around the issue by changing my |
you could try this: |
Is this something we should reopen / create a new issue? Helm 3.11/3.12/3.13 all render here numbers >= 1.000.000 as exponent, and all values are float64 Treating all numbers as String could not have been the intention of the creators :) |
Vote for reopening - just hit this too. |
This works no need to reopen this |
Simple test input test1: v11724e28
test2: 11724e28
test3: 2.10.6
test4: v2.10.6 helm template
output for a helm template command ---
# Source: test-helm/templates/test.yaml
test1: v11724e28
test1Type: string
test2: 1.1724e+32
test2Type: float64
test3: 2.10.6
test3Type: string
test4: v2.10.6
test4Type: string Can we have it fixed at some point? |
@ivankatliarchuk Isn't it an expected behavior? Yaml parser sees 11724e28 as a float. |
This is exactly what this thread is about no? Why does |
Also, within my own specific issue, I was using |
I suppose this thread is about the command line argument parser, not the YAML parser. |
Ah right sorry, I misinterpreted what you meant |
after reading through all this discussion i am stil confused ... is there any workaround so far ? like using "| quote" ? or what ? |
|
Vote for reopening. Just saw this as well.
with image:
tag: 87940363 becomes desired manifest of:
Using this does not work, because as soon as the tag changes to something that isn't an int, we have a helm problem.
|
You can quote image.tag with
|
The workaround appears to be to use |
How is this still a problem over 7 years later? |
thank you, work for me :) |
I just noticed that something like
helm install --set tag=20161216
ends up in scientific notation in the template and thats because{{ typeOf .Value.tag }}
yieldsfloat64
.Thats even true for small integers like
helm install --set tag=1
-->float64
.This is happening with helm 2.1.0
The text was updated successfully, but these errors were encountered: