k8s-openapi
k8s-openapi copied to clipboard
Allow skipping client generation
This is a draft because currently, it still fails on metrics.k8s.io.
So, with k3d & k3s v1.20.2, the error is definition io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup_v2 is a Resource but its URL path segment and scope could not be inferred.
/openapi/v2 contains the following (inside paths):
{
// ...
"/apis/metrics.k8s.io/": {
"get": {
"description": "get information of a group",
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"metrics"
],
"operationId": "getMetricsAPIGroup",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup_v2"
}
}
}
}
}
}
// ...
So I conclude k8s-openapi failure here is legitimate: for some reason schema contains two metav1.APIGroups copied.
I will check if the same happens in other distributions.
It'll need to be treated like the regular APIGroup - https://github.com/Arnavion/k8s-openapi/blob/445e89ec444ebb1c68e61361e64eec4c4a3f4785/k8s-openapi-codegen-common/src/lib.rs#L452-L456