You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Precision loss when handling large int64 numbers inside yaml config #11045
$ helm version
version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}
$ helm create example
Creating example
$ sed -i "s/replicaCount: 1/replicaCount: 9123456789012345678/" example/values.yaml
$ helm template example -f example/values.yaml | grep replicas
replicas: 9.123456789012346e+18
the desired replicaCount is 9123456789012345678 in values.yaml, but it becomes 9.123456789012346e+18 (aka 9123456789012346000) in the final rendered yaml.
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.
and when we use helm to generate the config.yaml file out of .Values.config, the precision loss will happen and we got ids in the config that will match the wrong ids.
Activity
configbp: Add Int64 type
configbp: Add Int64String type
configbp: Add Int64String type
github-actions commentedon Oct 5, 2022
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.
fishy commentedon Oct 6, 2022
this is still an issue.
joejulian commentedon Oct 11, 2022
This has to do with the go templating float precision. You can solve this yourself using printf:
fishy commentedon Oct 11, 2022
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:
and when we use helm to generate the
config.yamlfile out of.Values.config, the precision loss will happen and we got ids in the config that will match the wrong ids.joejulian commentedon Oct 11, 2022
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.