-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
[code-generator]: add register-gen to helper script kube_codegen.sh #124219
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Sun Apr 7 13:42:56 UTC 2024. |
Welcome @caozhuozi! |
Hi @caozhuozi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: caozhuozi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc @jpbetz |
/ok-to-test |
Thanks for the contribution! I haven't put much thought into what the edge cases for registration are, but we might be able to tease it out. I think we should merge the generation utilities in the same PR that makes use of the generators. This could get quite involved and result in a much larger PR. The basic shape I'd expect would include things like:
There are probably a lot of other details, hopefully that starts to summarize the path we'd need to go down to fully incorporate this into the codebase. |
Thank you for your comment. I will digest it one by one and make changes accordingly. |
/cc @thockin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that there are no real parameters, why not make this a --with-register
argument to gen_client()
?
It seems like a missing piece, so I am supportive. Agree that it should subsume the existing files which are manual. If it can't, I'd like to know why -- our examples should be pretty "normal".
Thank you for your ongoing attention to this PR. To be honest, I don't intend to give up on this PR. I just haven't had the time to focus on it recently.
I will change it.
The way I interpret this statement is that my PR does not use generated files to replace those existing files that were manually created. Yes, I agree with that. I will continue to work on this PR. |
PR needs rebase. 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-sigs/prow repository. |
Somehow there were two different PRs and I didn't realize. #124946 merged |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Register code is just as common as deepcopy, client, informer, defaulter (and so on) in CRD development.
However, the helper script kube_codegen.sh within the code-generator does not include a function for registration.
This pull request attempts to add it.
Which issue(s) this PR fixes:
Fixes kubernetes/code-generator#169
Special notes for your reviewer:
I am aware that some subsequent changes may also be necessary, such as replacing the manually created register file (e.g., ·examples/crd/apis/example/v1/register.go·) with the generated register version.
But I need your confirmation on this matter. Additionally, if any other subsequent changes need to be made, please also let me know.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: