-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 generating java classes from CRD that implement the Editable interface. #5878
Comments
There is a PR here: #5879 |
Thanks a lot for your input @matteriben , before moving on with this one I need to ask a few points:
|
@andreaTP this is in part to provide consistency with what is being done in the core client. It would be great if at some point we were using a single set of java generation logic :(
The closest would probably be to use the lombok Builder annotation with toBuilder=true. The downside there is that lombok builder logic doesn't provide nested fluent methods. |
Thanks for the context 🙏
Agreed What do you think about making it a breaking change:
|
You mean this change, or trying to align the generation logic? I think we can only do the former.
At this point this cannot be annotation driven alone, but aligning sounds good. |
Correct, this change, but we re-use the existing option to avoid increasing the matrix of possibilities to be maintained.
Would be nice to have a diff(e.g. comparing with the Approval Tests) of the target desired outcome. |
@andreaTP Could you please help me understand in what context or scenario this could be considered a breaking change? I understand you are considering the possibility of enabling this whenever |
My current thinking is that adding the I'm open to the challenge though, and, in the presence of evidence that this is an extremely safe change I'm happy to re-evaluate 🙂 . |
Do you have an estimate or target date for this?
I tried this locally, I got it to build on the main branches.
In the end I was able to build it. Though I made no code changes to get this to build, this change could potentially break an existing build if this feature is enabled (or extraAnnotations if we tie Editable to it), and the project doesn't already have the proper dependency for Editable (kubernetes-model-common), both at the time of annotation processing and compiling. I'm not sure how much of an issue that could be in general, but for this test project it was not an issue. |
Thanks for the analysis!
Not yet. |
Will it be possible to get an early snapshot build of 7.x? The reason I'm asking is because we would like to take advantage of this change as soon as possible. |
I tried rebuilding to verify the dependency requirements. Here's what I see: Without extraAnnotations:
Additionally with extraAnnotations:
All submodules under kubernetes-model-generator except kubernetes-model include a dependency on kubernetes-model-common. It seems to me adding Editable which does depend on I'll update the documentation to list these required dependencies for java-generator:
|
I updated the documentation here: #5918 |
Is your enhancement related to a problem? Please describe
I'd like classes generated from CRD to implement the Editable interface.
Describe the solution you'd like
A configuration option to cause the generated classes to implement the Editable interface, assuming extra annotations are enabled.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: