-
Notifications
You must be signed in to change notification settings - Fork 152
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
Support ad-hoc client generation for CRDs #121
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Would love to see this done. I'd be happy to help if I can. |
Generating clients for CRDs would be amazing |
Some of the modern Kubernetes clients use clients generated from a swagger.json kubernetes-client/javascript uses kubernetes-client/gen which uses OpenApiTools/openapi-generator and kubernetes/kubernetes/api/openapi-spec/swagger.json There are open/closed/rotten/ignored issues all over the place about making these easier to use with CRDs. Wrongly closed issue on kubernetes-client/javascript: kubernetes-client/javascript#341 Open issue on kubernetes-client/gen: kubernetes-client/gen#121 It seems like kubernetes/kube-openapi is one of the repos working on solving the main part of this problem, generating the Go code to make it easy to generate a swagger.json I found the following Argo code via the following issue: kubernetes/kube-openapi#13 https://github.com/argoproj/argo/blob/master/hack/gen-openapi-spec/main.go https://github.com/argoproj/argo/blob/master/pkg/apis/workflow/v1alpha1/openapi_generated.go#L14:6 https://github.com/kubernetes/kube-openapi/blob/master/cmd/openapi-gen/openapi-gen.go So I'm working on adding similar stuff to Shipper. gen-openapi-spec uses the generated openapi_generated.go module that is generated via the openapi-gen command. The following commit adds the code to generate openapi_generated.go Signed-off-by: William Stewart <zoidbergwill@gmail.com>
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen ? |
I think this would be a useful feature. I recently went down this route, of trying to get this working, and it was painful and required some manual work too: bookingcom/shipper#243 |
/reopen |
@yue9944882: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@zoidbergwill we had an experimental CRD model generator for java (just generating model would be sufficient b/c we have custom-object api to be the general client) https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md. it will require kubernetes v1.15+ tho. it works for us in production.. |
/lifecycle active |
@yue9944882 @zoidbergwill we had success using https://github.com/kubernetes-client/gen/ for our case. we grabbed |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I had some luck in December, but it was pretty painful. I also ended up doing a bunch of copypasta by hand. Most of it is documented in bookingcom/shipper#243 |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
/lifecycle frozen |
UPDATE: for java the CRD models now can also be written manually by properly implementing some interfaces: kubernetes-client/java#1020 |
After roughly 1.5 year, is anyone actually working on this issue? |
The work on the java client has been pretty active. I'm not sure about other languages though. I guess a status at the main github issue status for other languages would be handy. |
I'm looking to generate client-go for CRD, does anyone know of any way? Have check the https://github.com/kubernetes/code-generator and seems like it's base the golang (mean base on mode of golang, like types.go ) and i just have the CRD files, it's generate from rust. EDIT: checking the https://github.com/OpenAPITools/openapi-generator |
as 1.15's out, users can publish their own openapi spec w/ CRD integration. we should probably refactor the scripts to support ad-hoc client generations.
/cc @brendandburns @roycaihw
The text was updated successfully, but these errors were encountered: