Skip to content
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

Allow skipping client generation #102

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MikailBag
Copy link
Contributor

This is a draft because currently, it still fails on metrics.k8s.io.

@MikailBag
Copy link
Contributor Author

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.

@Arnavion
Copy link
Owner

It'll need to be treated like the regular APIGroup -

"io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" |
"io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList" |
"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" |
"io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions" =>
namespace_or_cluster_scoped_url_path_segment_and_scope.push((r#""""#.to_owned(), format!("{}ClusterResourceScope", local))),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants