-
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
✨ feat(go/v4): add support for custom boilerplate path #3716
✨ feat(go/v4): add support for custom boilerplate path #3716
Conversation
Signed-off-by: Ardika Bagus <[email protected]>
Welcome @ardikabs! |
Hi @ardikabs. Thanks for your PR. I'm waiting for a kubernetes-sigs 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: ardikabs 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 |
As I am new to the kubebuilder codebase, please be advised on where I should put a test for this feature. Thanks! |
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.
The change cannot be made within the API command. Doing so would mean that we would be able to define a different value for each API.
If we allow customization, it must be done via the kubebuilder init and kubebuilder edit commands. Additionally, the path must be stored in the PROJECT file.
Could you please take a look at it and see if you have any concerns?
+1 to what @camilamacedo86 mentioned. Allowing boilerplate configured differently during these commands would lead to confusion of: |
See the e2e tests: https://github.com/kubernetes-sigs/kubebuilder/tree/master/test/e2e To create the tests that would be new dir with a test like the others just to check the layout after the change.
|
Hi @ardikabs I am closing this one since, as we spoke if we would like to add this feature, we need to add it for the init|edit subcommand and keep the data stored in the PROJECT file so that it can be used across since it is valid for the whole project. We cannot have one specific config for each API. Therefore, I hope that you do not mind if we close this one, and please feel free to raise a new PR with the proposed solution or reopen this one. |
Description
Add support to a custom boilerplate path for the
base.go.kubebuilder.io/v4
plugin.The following are changes involved in this feature request:
--boilerplatePath
flag tokubebuilder --plugin "base.go.kubebuilder.io/v4" init
--boilerplatePath
flag tokubebuilder --plugin "base.go.kubebuilder.io/v4" create api
--boilerplatePath
flag tokubebuilder --plugin "base.go.kubebuilder.io/v4" create webhook
Expectation
After applying this feature, you can customize the boilerplate file path to any path other than the default (
hack/boilerplate.go.txt
), like the following examples:Init
Create API
Create Webhook