Skip to content

✨ (CLI, go/v4): Upgrade Golang version to v1.24.0 #4585

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Feb 28, 2025

Upgrade go version 1.23 to 1.24

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @dongjiang1989!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Feb 28, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @dongjiang1989. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 28, 2025
@camilamacedo86
Copy link
Member

/ok-to-test

@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 Feb 28, 2025
@dongjiang1989
Copy link
Contributor Author

dongjiang1989 commented Feb 28, 2025

@camilamacedo86 How to change golang version here?
ref: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kubebuilder/4585/pull-kubebuilder-test/1895464276731105280

Maybe change prow image image: public.ecr.aws/docker/library/golang:1.23 to image: public.ecr.aws/docker/library/golang:1.24

@camilamacedo86
Copy link
Member

camilamacedo86 commented Feb 28, 2025

Hi @dongjiang1989

Maybe change prow image image: public.ecr.aws/docker/library/golang:1.23 to image: public.ecr.aws/docker/library/golang:1.24

We will need to update the the test-infra: http://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml#L14

Feel free to push a PR and ping me.
I will be happy to approve 👍

@dongjiang1989
Copy link
Contributor Author

@camilamacedo86
Copy link
Member

Hi @dongjiang1989

I saw that you open the PR there as well.
Let's wait just a little ideally, we should only bump the Golang when it is bumped in the k8s API and controller-runtime and we bump here. But lets give a couple of weeks, then I think we can go.

@camilamacedo86
Copy link
Member

@camilamacedo86
Copy link
Member

@dongjiang1989

Let's bump controller-runtime latest release which still uses 1.23 : https://github.com/kubernetes-sigs/controller-runtime/blob/v0.20.3/go.mod

Do a patch release, and then I think we might can move forward with this one.

@dongjiang1989
Copy link
Contributor Author

dongjiang1989 commented Mar 12, 2025

@dongjiang1989

Let's bump controller-runtime latest release which still uses 1.23 : https://github.com/kubernetes-sigs/controller-runtime/blob/v0.20.3/go.mod

Do a patch release, and then I think we might can move forward with this one.

Thanks @camilamacedo86
Got it.
controller-runtime master branch update golang version to v1.24:
kubernetes-sigs/controller-runtime@9d65299

Patch it to controller-runtime v0.20.x?

@camilamacedo86
Copy link
Member

/lgtm
/approved
/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 Mar 26, 2025
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2025
@camilamacedo86
Copy link
Member

Hi @dongjiang1989

we need to upgrade the golang-ci to allow it pass

@mateusoliveira43
Copy link

@camilamacedo86 checking errors, maybe we do not need to update linter for this one to pass. I think error is related to how it is being installed. If we use go install both in root Makefile

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.63.4 ;\
like is done for testdata
GOBIN=$(LOCALBIN) go install $${package} ;\

and in github actions
version: v1.63.4
https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#install-mode

I think CI will work for this one (without changing linter version)

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.

Can you please help us ensure that it pass in the CI and also squash the commits to allow us to move forward?

@dongjiang1989 dongjiang1989 force-pushed the update-go-1.24 branch 2 times, most recently from a927b6d to 49d5eac Compare April 1, 2025 01:52
@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 Apr 1, 2025
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 1, 2025
Signed-off-by: dongjiang <[email protected]>

fix golangci lint

Signed-off-by: dongjiang <[email protected]>

revent golangcl-lint

Signed-off-by: dongjiang <[email protected]>

add go install mode

Signed-off-by: dongjiang <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 1, 2025
@dongjiang1989
Copy link
Contributor Author

dongjiang1989 commented Apr 1, 2025

Hi @dongjiang1989,

Thank you so much for this one! 👍 Everything looks great — we're just missing one last step: squashing the commits.

We follow a policy of having one commit per PR for each need/requirement/change. This helps us maintain a clean Git history and makes things easier when we need to revert or track changes.

Could you please squash the commits so we can get this one merged? 🙏

Thanks again!

Done :)

@@ -38,6 +38,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
install-mode: goinstall
Copy link
Member

@camilamacedo86 camilamacedo86 Apr 1, 2025

Choose a reason for hiding this comment

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

I understand that allowing us to pass the CI and ensure that the lint works was required.
Am I right? Would it work without this change?

This change solved the issue

Error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.0)
Failed executing command with error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.0)

Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Solved it done.

Copy link
Member

Choose a reason for hiding this comment

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

Lets move forward but I create an issue to see if we can remove it before the next release or if we should leave it as it is now: #4750

Copy link

Choose a reason for hiding this comment

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

This was not the right fix.

You are using golangci-lint v1.63, the first version of golangci-lint that supports go1.24 is golangci-lint v1.64.

The right fix is to update the golangci-lint version to a version that support go1.24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @ldez
Got it

@dongjiang1989
Copy link
Contributor Author

Thanks @camilamacedo86 Please re-check it :)

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
/approve
/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 Apr 2, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, dongjiang1989

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 Apr 2, 2025
@k8s-ci-robot k8s-ci-robot merged commit b878bf9 into kubernetes-sigs:master Apr 2, 2025
58 of 61 checks passed
@dongjiang1989 dongjiang1989 deleted the update-go-1.24 branch April 3, 2025 01:43
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants