-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Precision loss when handling large int64 numbers inside yaml config #11045
Comments
This is a helper type used in yaml configs, mainly to deal with a helm bug [1] that large int64 values in yaml config could have precision loss when going through helm, so we would want to put the string versions of them in yaml to preserve the precision. [1]: helm/helm#11045
This is a helper type to be used in yaml configs, mainly to deal with a helm bug [1] that large int64 values in yaml config could have precision loss when going through helm, so we would want to put the string versions of them in yaml to preserve the precision. [1]: helm/helm#11045
This is a helper type to be used in yaml configs, mainly to deal with a helm bug [1] that large int64 values in yaml config could have precision loss when going through helm, so we would want to put the string versions of them in yaml to preserve the precision. [1]: helm/helm#11045
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
this is still an issue. |
This has to do with the go templating float precision. You can solve this yourself using printf:
|
while that workaround works for some cases, it doesn't really work for other cases. for example, we have a helm template to generate yaml config files to be mounted to our pods, and the value files could be some thing like this: otherKey: otherValue
config:
foo: bar
idDenyList:
- 9123456789012345678
- <other really big int64 ids>
... and when we use helm to generate the |
Please file an issue with golang at https://github.com/golang/go/issues. Prefix your issue with "x/text:" in the subject line, so it is easy to find. |
This is a minimal example to demonstrate the bug:
the desired
replicaCount
is9123456789012345678
invalues.yaml
, but it becomes9.123456789012346e+18
(aka9123456789012346000
) in the final rendered yaml.The text was updated successfully, but these errors were encountered: