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

OpenAPI: Go to OpenAPI/Swagger generator #6131

Closed
manusa opened this issue Jul 12, 2024 · 0 comments · Fixed by #6134
Closed

OpenAPI: Go to OpenAPI/Swagger generator #6131

manusa opened this issue Jul 12, 2024 · 0 comments · Fixed by #6134
Assignees
Labels
component/kubernetes-model Deals with the kubernetes-model
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jul 12, 2024

Description

Part of #6130

The OpenAPI spec published by Kubernetes or by the cluster (kubectl get --raw /openapi/v2) lacks model for some types. These types are those used in webhooks, types for the representation of the .kube/config file, and types used in common extensions (metrics server, gateway-api, and so on).

To be able to generate the Java types using the new OpenAPI approach, we still need some mechanism to extract these specifications from the Go types and structs.

Specifications

  • Implement a new Go module in kubernetes-model-generator/openapi/generator:
    module github.com/fabric8io/kubernetes-client/kubernetes-model-generator/openapi/generator
  • Implement a CLI that accepts a single parameter to specify the output directory of the generated OpenAPI specs
    $ generator ./output
  • Generated APIs (more can be added later)
    Name Description
    kubernetes-config.json Types used in the Kubernetes configuration file (.kube/config)
    api-machinery-extra.json Additional types in apimachinery not directory exposed in swagger.json
    admission-registration.json Webhooks for this group
    gateway-api.json https://github.com/kubernetes-sigs/gateway-api
    kustomize.json https://github.com/kubernetes-sigs/kustomize
    metrics-server.json https://github.com/kubernetes-sigs/metrics-server

Implementation tasks and PRs

These are some of the bits that have already been implemented as part of the work done for #6080.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/kubernetes-model Deals with the kubernetes-model
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant