Skip to content

Conversation

@HaraldNordgren
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 30, 2025
@HaraldNordgren HaraldNordgren changed the title modernize for loops modernize counting loops Oct 30, 2025
@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 Oct 30, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @HaraldNordgren. Thanks for your PR.

I'm waiting for a github.com 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.

Details

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 30, 2025
@HaraldNordgren HaraldNordgren changed the title modernize counting loops 🌱 modernize counting loops Oct 30, 2025
@HaraldNordgren HaraldNordgren changed the title 🌱 modernize counting loops 🌱 modernize loops Oct 30, 2025
@HaraldNordgren HaraldNordgren marked this pull request as ready for review October 30, 2025 16:47
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 30, 2025
@JoelSpeed
Copy link
Contributor

/ok-to-test

Is there a linter we can use to prevent people using this old style?

@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 Oct 30, 2025
@HaraldNordgren
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 1, 2025
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 1, 2025
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 1, 2025
@HaraldNordgren HaraldNordgren changed the title 🌱 modernize loops 🌱 use modernize linter Nov 1, 2025
@HaraldNordgren HaraldNordgren force-pushed the main branch 4 times, most recently from e282e18 to 9509357 Compare November 1, 2025 14:50
content = []byte(strings.ReplaceAll(string(content), "testdata/cronjob/api/v1/applyconfiguration", filepath.Join("testdata/cronjob/api/v1", outputPackage)))

// Make sure the interface{} is replaced with any.
content = []byte(strings.ReplaceAll(string(content), "any", "interface{}"))
Copy link
Contributor 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 this is necessary, it's causes by my changing the signature of ForKind. But it's not clear to me why I can't get Golang to just output "any" on the generated code.

@HaraldNordgren
Copy link
Contributor Author

Hi @JoelSpeed, there is the modernize linter which I added now, it required me to change more than I expected.

Do you think it's a good change?

Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Where code is being generated by upstream generators (applyconfiguration) I don't think it makes sense to apply these rules so lets have an exception, otherwise I think this is fine

Any opinions @sbueringer or @alvaroaleman ?

@HaraldNordgren
Copy link
Contributor Author

@JoelSpeed Reverted that change now 👍

@JoelSpeed
Copy link
Contributor

@HaraldNordgren It seems the linting check is passing, though I don't see an exception for the generated files. Are we excluding the generated files already somehow?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2025
@sbueringer
Copy link
Member

Where code is being generated by upstream generators (applyconfiguration) I don't think it makes sense to apply these rules so lets have an exception, otherwise I think this is fine

Any opinions @sbueringer or @alvaroaleman ?

Agree. Generated code should be excluded

Copy link
Member

@dongjiang1989 dongjiang1989 left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link
Contributor

@dongjiang1989: changing LGTM is restricted to collaborators

Details

In response to this:

LGTM

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 removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 1, 2025
@JoelSpeed
Copy link
Contributor

/label tide/merge-method-squash
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 4, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 4, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

DetailsGit tree hash: 6108f9ad63ea98870465a75e81f98fb64a19e121

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dongjiang1989, HaraldNordgren, JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Dec 4, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2f0db50 into kubernetes-sigs:main Dec 4, 2025
9 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants