Comments (5)
Is there something that I missed?
Yes, you missed that this code is auto-generated from the OpenAPI spec. It's not like I made the conscious decision to represent port numbers as i32
. :)
So, to that end, the OpenAPI spec says:
"io.k8s.api.networking.v1.ServiceBackendPort": {
"description": "ServiceBackendPort is the service port being referenced.",
"properties": {
"name": {
"description": "name is the name of the port on the Service. This is a mutually exclusive setting with \"Number\".",
"type": "string"
},
"number": {
"description": "number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with \"Name\".",
"format": "int32",
"type": "integer"
}
},
"type": "object"
}
"format": "int32"
At this point you might say it's a spec bug and would be resolved by specifying a better format
. But even the API server code says:
Number int32
🤷 Complain to upstream.
from k8s-openapi.
Yes, you're right, just after create this issue I went to the OpenApi specs and found the same.
I will scale the question to the openapi people.
Thanks a lot man.
from k8s-openapi.
Well, OpenAPI supports specifying integer ranges using minimum
and maximum
, but the Kubernetes OpenAPI spec is downstream of their golang code so they'd have to invent new annotations to express that. Besides, ServiceBackendPort::number
is far from the only field that has this problem; searching for : Option<i32>,
in this repo reveals all sorts of time durations and replica counts and percentages, and upstream would have to fix all of them for completeness.
from k8s-openapi.
Upstream issue: kubernetes/kubernetes#105533
from k8s-openapi.
Upstream issue: kubernetes/kubernetes#105533
👍🏻
from k8s-openapi.
Related Issues (20)
- VolumeSnapshot and friends? HOT 2
- Consider extending the crate with merge functionality HOT 7
- Documentation snippet about kubernetes detection is not working as expected HOT 4
- Improve Name and Namespace optionality HOT 7
- `apimachinery::pkg::api::resource::Quantity` compatibility with Go HOT 2
- `MicroTime` can be `null` HOT 6
- Add `latest` and `earliest` version features that track highest and lowest supported version HOT 1
- Can't find `meta/v1/Duration` HOT 2
- `k8s_openapi::ListResponse` should be serializable HOT 2
- release with v1.27 HOT 3
- v1.28.0
- Looking for example on how to use k8s_openapi::api::core::v1::Event::create function HOT 1
- ServiceSpec not creating headless service when cluster_ip set to None HOT 4
- Size of generated code HOT 7
- Tracking issue for bringing back API operations-related code if there is demand HOT 6
- about k8s-openapi features upgrade question HOT 4
- Comparison of elements is too strict HOT 2
- int-or-string parameters are typed out with mismatched "type" property HOT 2
- Namespaces are not Serializing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8s-openapi.