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

Use Go 1.21 min/max builtins #125046

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tklauser
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The min and max builtins are available since Go 1.211. The top-level go.mod file is specifying Go 1.22, so the builtins can be used instead of implementing them multiple times across the code base.

Which issue(s) this PR fixes:

non

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Footnotes

  1. https://go.dev/doc/go1.21#language

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 22, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @tklauser. Thanks for your PR.

I'm waiting for a kubernetes 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 requested review from jpbetz and mwielgus May 22, 2024 08:47
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 22, 2024
@ffromani
Copy link
Contributor

/ok-to-test
/triage accepted
/priority backlog

@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. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 22, 2024
@ffromani
Copy link
Contributor

/lgtm

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

LGTM label has been added.

Git tree hash: d4b81e52174bdcaea3a46e6df2b6ff5a848e69c5

@tklauser tklauser force-pushed the min-max-builtins branch from 22b986c to 293e861 Compare May 23, 2024 07:39
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 23, 2024
@k8s-ci-robot k8s-ci-robot requested a review from ffromani May 23, 2024 07:39
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 23, 2024
@tklauser
Copy link
Contributor Author

/retest

@tklauser tklauser force-pushed the min-max-builtins branch from 293e861 to fc43eb3 Compare May 23, 2024 07:53
@tklauser
Copy link
Contributor Author

/retest

@tklauser tklauser force-pushed the min-max-builtins branch from fc43eb3 to d14d6ec Compare May 23, 2024 08:51
@tklauser
Copy link
Contributor Author

/retest

1 similar comment
@tklauser
Copy link
Contributor Author

/retest

@tklauser tklauser force-pushed the min-max-builtins branch from d14d6ec to 2f7010c Compare May 23, 2024 14:52
@tklauser
Copy link
Contributor Author

/retest

@tklauser
Copy link
Contributor Author

tklauser commented Aug 7, 2024

/retest

@tklauser
Copy link
Contributor Author

tklauser commented Aug 7, 2024

Gentle ping @ffromani. I've rebased this on latest master branch. Is there anything else needed on this PR to be reviewed and eventually merged?

@ffromani
Copy link
Contributor

ffromani commented Aug 7, 2024

Gentle ping @ffromani. I've rebased this on latest master branch. Is there anything else needed on this PR to be reviewed and eventually merged?

need review from sig-api-machinery folks, which are already tagged in the PR I believe

@tklauser
Copy link
Contributor Author

tklauser commented Aug 7, 2024

/test pull-kubernetes-integration

@tklauser
Copy link
Contributor Author

Ping, this PR has been open for a while. Would it be possible to get it reviewed? Thank you!

The `min` and `max` builtins are available since Go 1.21[^1]. The
top-level go.mod file is specifying Go 1.22, so the builtins can be
used.

[^1]: https://go.dev/doc/go1.21#language
@tklauser
Copy link
Contributor Author

/retest

@tklauser
Copy link
Contributor Author

/test pull-kubernetes-unit

@tklauser
Copy link
Contributor Author

tklauser commented Nov 5, 2024

This has been sitting here for a while. @jpbetz @mwielgus @ffromani, any chance you could give this a review? Thank you!

@jpbetz
Copy link
Contributor

jpbetz commented Nov 5, 2024

/lgtm
/approve

The need for function wrappers is too bad, but I don't see any other way to do it.

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

LGTM label has been added.

Git tree hash: d6205e09499e6b8d04bb628356d0a48510cc3741

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jpbetz, tklauser

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

@ffromani
Copy link
Contributor

ffromani commented Nov 5, 2024

/assign mwielgus

@tklauser
Copy link
Contributor Author

Sorry for pinging again. This has been open for quite a while and it looks like approval from an approver in pkg/controller/podautoscaler/OWNERS is still needed. @mwielgus, any chance you could take a look? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

5 participants