-
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
🐛 cleanup/enhancement: keep all variables used defined on top ofmain.go
#4036
Conversation
Hi @fengshunli. 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-sigs/prow repository. |
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.
Thank you for your contribution.
After do change you must run make generate
so that all samples and docs are updated accordingly. So, could you please do that and ensure that your PR will result with just 1 commit so that we can get this one merged?
@camilamacedo86 done |
5c15612
to
b493b93
Compare
main.go
to achieve unified variable management
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.
/ok-to-test
/approved
/lgtm
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.
Just a nit sorry.
Could you please address this one : https://github.com/kubernetes-sigs/kubebuilder/pull/4036/files#r1686316224 for we get it merged
Also, see that I updated the title since we use it to generate the release notes.
done |
var ( | ||
metricsAddr string | ||
enableLeaderElection bool | ||
probeAddr string | ||
secureMetrics bool | ||
enableHTTP2 bool | ||
tlsOpts []func(*tls.Config) | ||
) |
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.
var ( | |
metricsAddr string | |
enableLeaderElection bool | |
probeAddr string | |
secureMetrics bool | |
enableHTTP2 bool | |
tlsOpts []func(*tls.Config) | |
) | |
var metricsAddr string | |
var enableLeaderElection bool | |
var probeAddr string | |
var secureMetrics bool | |
var enableHTTP2 bool | |
var tlsOpts []func(*tls.Config) |
That ^ @fengshunli and then just run make generate
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 don't understand why the var code block is not used here to define it. Isn't the code block definition more standardized? @camilamacedo86
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.
What value do add with this change?
It will only make harder for people upgrade/update their project with the latest changes
It has no need to change it in the scaffold. Lets try to only do in each PR what is required to achieve the goal of the PR itself.
main.go
to achieve unified variable managementmain.go
to achieve unified variable management
main.go
to achieve unified variable managementmain.go
main.go
main.go
main.go
main.go
@@ -64,8 +64,6 @@ func init() { | |||
/* | |||
*/ | |||
func main() { | |||
/* | |||
*/ |
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.
Can you please revert it ?
It is used in the docs to render the code and has no relation with the purpose of this PR
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.
done
…management Signed-off-by: fsl <1171313930@qq.com>
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
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, fengshunli 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 |
This update streamlines the code and enhances maintainability by centralizing variable definitions.