-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
java-model-gen generates CRD that imports non-exist class #921
Comments
Yeah, probably. There is a pre-processor here: https://github.com/kubernetes-client/gen/blob/master/openapi/preprocess_spec.py That massages the swagger spec to do things like this. We're open to productionizing that script/image but I'm not sure anyone has the cycles to do it right now. |
@brendandburns Thanks. Replacing to
When I try to run the controller, i got the following error message.
Apparently |
cc @yue9944882 Not sure what the plans to productionize it are, but if you wanted to improve it and submit a PR to this repo that would be awesome. |
Exactly. There're a few manual changes have to be done after the code-generation, at least you're not only required to replace
There was plan to enhance the java model generator. @brendandburns I was thinking about introducing java models for other commonly-used repos e.g. kubefed, istio, helm. etc (probably in a separated module named |
@yue9944882 Thanks! Yeah two fields need to be fixed manually,
Do you know why a new metadata field was generated for |
Any updates on this issue? It seems like We would like to help fixing this, at is it currently blocking our progress. But it will require some guidance to where/how to apply a fix. |
For my workaround I had to edit the swagger.json by hand to add |
@erikgb Can you try kubernetes-client/gen#161 ? It contains a fix in pre-processing for V1ObjectMeta and V1ListMeta |
@aespinosa Sorry for the delay. It seems like the pull request is already merged! I have been using the image create from https://github.com/yue9944882/java-model-gen, so to test your pull request would require some additional work/time that I did not have until now. @yue9944882 Any chance for you to update your excellent java-model-gen image with the changes submitted by @aespinosa? |
@erikgb i opened #981 to switch the model-generation guides to the scripts by @aespinosa , any comments are welcome. thanks |
@yue9944882 It seems like a good idea to drop the container image approach for generating code for custom resources. I will try to "test" your proposed update to the docs and report back any findings. |
@yue9944882 I have reviewed #981, and added a couple of minor comments. Sadly I was unable to verify the new approach with my current setup: I want to run this class generation as part of a GitLab CI/CD pipeline configured with Docker runners. Since the invoked scripts are invoking |
i think @yue9944882 's workflow is meant have code generated and checked-in by hand. For integrating with CI pipelines, you might want to tap directly to |
UPDATE: the CRD models now can also be written manually by properly implementing some interfaces: #1020 |
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. |
I followed https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md to generate Java client for CRD. However, the generated file imports the following class which doesn't exist in generated file nor library
Actually, should I just replace it with the following?
By the way, any plan to productionize
yue9944882/java-model-gen
docker image in this repo?The text was updated successfully, but these errors were encountered: