Skip to content
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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

fengshunli
Copy link
Member

@fengshunli fengshunli commented Jul 21, 2024

This update streamlines the code and enhances maintainability by centralizing variable definitions.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 21, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 21, 2024
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 21, 2024
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fengshunli

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?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 21, 2024
@fengshunli
Copy link
Member Author

@camilamacedo86 done

@fengshunli fengshunli force-pushed the var branch 2 times, most recently from 5c15612 to b493b93 Compare July 21, 2024 12:40
@camilamacedo86 camilamacedo86 changed the title Unified variable management ✨ Improved variable definitions in main.go to achieve unified variable management Jul 22, 2024
Copy link
Member

@camilamacedo86 camilamacedo86 left a 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

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 22, 2024
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 22, 2024
Copy link
Member

@camilamacedo86 camilamacedo86 left a 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.

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2024
@camilamacedo86 camilamacedo86 removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2024
@fengshunli
Copy link
Member Author

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

Comment on lines 224 to 231
var (
metricsAddr string
enableLeaderElection bool
probeAddr string
secureMetrics bool
enableHTTP2 bool
tlsOpts []func(*tls.Config)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member Author

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

Copy link
Member

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.

@camilamacedo86 camilamacedo86 changed the title ✨ Improved variable definitions in main.go to achieve unified variable management ✨ enhance in themain.go to achieve unified variable management Jul 22, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ enhance in themain.go to achieve unified variable management ✨ cleanup/enhance: keep all variables used defined on top ofmain.go Jul 22, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ cleanup/enhance: keep all variables used defined on top ofmain.go ✨ cleanup/enhancement: keep all variables used defined on top ofmain.go Jul 22, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ cleanup/enhancement: keep all variables used defined on top ofmain.go 🐛 cleanup/enhancement: keep all variables used defined on top ofmain.go Jul 22, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 22, 2024
@@ -64,8 +64,6 @@ func init() {
/*
*/
func main() {
/*
*/
Copy link
Member

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

Copy link
Member Author

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>
Copy link
Member

@camilamacedo86 camilamacedo86 left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 23, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2024
@k8s-ci-robot k8s-ci-robot merged commit 73848f8 into kubernetes-sigs:master Jul 23, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants