-
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
✨ add comments for the exported methods in generated controllers (only v3+) #1690
Conversation
Welcome @bvwells! |
Hi @bvwells. 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. |
Need to sort out issues running make generate... |
pkg/plugin/v3/scaffolds/internal/templates/config/controller/controller.go
Outdated
Show resolved
Hide resolved
pkg/plugin/v3/scaffolds/internal/templates/config/controller/controller.go
Outdated
Show resolved
Hide resolved
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 am all in to make the code better and more intuitive by providing an aditional info/doc. However, note that we need to be conscious with its definitions and aligned with the controller-runtime where it is implemented and also would be nice to make it easier to keep maintained. I mean, avoid the doc/text be easily outdated.
So, shows that a good option would add a very generic and small text to point users check its docs in the controller-runtime. Then, the best approach here would we need to use the tag as well to ensure that the users would get the docs according to the controller-runtime dep used. E.g;
https://github.com/kubernetes-sigs/controller-runtime/blob/v0.6.3/pkg/reconcile/reconcile.go
The tag above is v0.6.3
. Note that the controller-runtime version used by the projects is defined in:
kubebuilder/pkg/plugin/v3/scaffolds/init.go
Lines 40 to 41 in 903abf8
ControllerRuntimeVersion = "v0.6.2" | |
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project |
kubebuilder/pkg/plugin/v3/scaffolds/init.go
Line 112 in 903abf8
&templates.GoMod{ControllerRuntimeVersion: ControllerRuntimeVersion}, |
WDYT?
Thanks for the review @camilamacedo86. The comment was copied across from operator-framework/operator-sdk prior it aligned with kubebuilder. I'll see if I can reword the comment as per your suggestions. |
Hi @bvwells,
You might be looking at some code that was describing the code/example scaffolded in the old versions. However, in POV SDK and Kube regards the controller/reconcile should be aligned controller-runtime where its implementation came from. I am looking for your improvements. Really thank you for your contribution 🥇 |
Hi @camilamacedo86, yes in operator-sdk there was documentation describing the reconcile loop. See here I noticed that this documentation disappeared when operator-sdk aligned with kubebuilder in v0.0.19. This is why I submitted the issue. |
I'll try to sketch something out this weekend. |
Hi @camilamacedo86, hope you had a good weekend! Made a few changes to the Reconcile documentation. Let me know what you think. I'm more than happy to iterate on it. |
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.
Really thank you for your contribution.
It shows great for me. 👍 Could you just rebase it with the master and re-gen the testdata with make generate
to update this PR?
c/c @gab-satchi @estroz WDYT?
/ok-to-test |
/approve However, note it will not pass in the CI before you update it with the master branch. |
Thanks for the reviews @camilamacedo86! All rebased to master. |
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
I'm not setting the lgtm
flag to let @camilamacedo86 have the last word as she already set the approved
flag and if I set the lgtm
one it will get merged.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Adirio, bvwells, camilamacedo86 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 |
Hi @Adirio, Thank you for your review on that. It shows fine for me as well. I think it might be helpful to end-users in order to address common questions. So, /lgtm |
Thanks @camilamacedo86 and @Adirio for your help getting this over the line! |
Description
Add comments for exported methods in generated controllers in order to provide help for users.
Motivation
Closes #1606.