-
Notifications
You must be signed in to change notification settings - Fork 147
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 client generation for CRD #59
Comments
cc: @brendanburns |
I tried using the swagger-generator directly who produced something https://github.com/tamalsaha/kube-openapi-generator . I am not sure whether I should be generating types shared from Kubernetes types and also how should auth work. |
You can add a flag to client generator to completely bypass preprocessing step if you don't need it. |
I did some experimentation with the Java client generator for our Voyager project and was able to generate client. The generated client uses the models from Kubernetes java-client. One limitation is that there is no util.Config so instantiating client is kind of awkward. Here are the relevant repos:
Here is the list of changes I had to make:
I would like to get your comments on how CRD projects should generate client for their projects based on this experiment. |
To generate client for CRDs, I needed to use a forked version of swagger-api. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-api. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-codegen. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-api. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-api. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-codegen. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-codegen. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-codegen. ref: kubernetes-client#59 (comment)
To generate client for CRDs, I needed to use a forked version of swagger-api. ref: #59 (comment)
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. |
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. |
Following @mbohlool 's advice kubernetes/kube-openapi#13 (comment), I have managed to generate swagger.json for my CRD. In the spirit of not reinventing the wheel, I was hoping to generate Java client using this repo. But I noticed that the swagger.json file is hardcoded to Kubernetes repos swagger.json https://github.com/kubernetes-client/gen/blob/master/openapi/preprocess_spec.py#L302 .
Do you have any suggestion how can I go about generating Java client from my CRD's swagger.json ?
The text was updated successfully, but these errors were encountered: