Upjet shouldn't generate types with float fields
- Dominant language
- Go
- Stars
- 481
- Forks
- 131
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 11
Description
### What happened?
In https://github.com/crossplane-contrib/provider-upjet-gcp/pull/623 various fields that appear to really be integers (e.g. `port`) are generated with type `*float64`. This led to a request to add `paved.GetFloat()` - some context and discussion in https://github.com/crossplane/crossplane-runtime/pull/778.
You're not supposed to use floats in Kubernetes APIs. From https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#primitive-types:
> Avoid floating-point values as much as possible, and never use them in spec. Floating-point values cannot be reliably round-tripped (encoded and re-decoded) without changing, and have varying precision and representations across languages and architectures.
See for example https://github.com/kubernetes-sigs/json, which deserializes JSON numbers into `int64` where possible.
### How can we reproduce it?
Take a look at the generated types in https://github.com/crossplane-contrib/provider-upjet-gcp/pull/623.
Contributor guide
Assessment
This issue has not been assessed yet.