-
Notifications
You must be signed in to change notification settings - Fork 261
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
🌱 Enhancements to how controller-gen is invoked #1911
Conversation
generate-controller-gen and generate-conversion-gen targets are split out of generate-go
When conversion-gen has to generate a dependency between 2 input packages it uses the value passed to --input-dirs as the package name in the generated import. This does not work if that value is a directory name. If you specify a package name here instead it works correctly. We also stop trying to generate conversions for versions which don't need them.
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
--input-dirs=./api/v1beta1 \ | ||
--input-dirs=$(capo_module)/api/v1alpha5 \ | ||
--input-dirs=$(capo_module)/api/v1alpha6 \ | ||
--input-dirs=$(capo_module)/api/v1alpha7 \ |
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.
I'm not sure why v1beta1
is missing but I won't block you on that, maybe there is a reason behind.
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.
Yep, it's deliberately excluded because we don't need to generate conversions for v1beta1 (or v1alpha1).
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.
/lgtm
/hold
for a question that I have, but feel free to hold cancel if it's all good.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: EmilienM, mdbooth The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
This PR includes 2 commits which each make a single change to how the Makefile does code generation.
The first adds the following 2 separate targets:
These invoke
controller-gen
andconversion-gen
respectively. These were previously invoked by thegenerate-go
target, but that target is now reduced to simply executinggo generate ./...
.The
generate
target continues to invoke all code generation.The advantage of this is the ability to easily run only the generation you need during development.
The second commit changes the behaviour of
generate-conversion-gen
. This produces no change in output against the current codebase, but fixes an issue generating an incorrect package internal package name should conversion-gen want to add a dependency between packages. I encountered this when I made a change which caused it to do this, which has not yet landed.