Skip to content

Update golangci-lint to v2.11.3#3911

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
stmcginnis:golangci-lint2
Mar 12, 2026
Merged

Update golangci-lint to v2.11.3#3911
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
stmcginnis:golangci-lint2

Conversation

@stmcginnis
Copy link
Copy Markdown
Contributor

@stmcginnis stmcginnis commented Apr 11, 2025

Golangci-lint has released a new major version that includes some changes to how it is configured, along with the usual linter updates that come with every release.

This updates the golangci-lint version we use to v2.11.3 (the current latest release) and updates the config file to conform to the new format. Also includes quite a few trivial updates to address the new warnings from the updated linters.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/provider/docker Issues or PRs related to docker area/provider/nerdctl Issues or PRs related to nerdctl approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/podman Issues or PRs related to podman size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 11, 2025
@k8s-ci-robot k8s-ci-robot requested a review from aojea April 11, 2025 14:23
Comment thread pkg/cluster/internal/create/actions/action.go
@aojea
Copy link
Copy Markdown
Contributor

aojea commented Apr 12, 2025

github actions runners have bug in the kernel

2025-04-11T14:24:57.741538117Z stderr F 	ip6tables-restore v1.8.9 (nf_tables): unknown option "--xor-mark"
2025-04-11T14:24:57.741540752Z stderr F 	Error occurred at line: 22
2025-04-11T14:24:57.741543337Z stderr F 	Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
2025-04-11T14:24:57.741546342Z stderr F  > ipFamily="IPv6"

actions/runner-images#11985

Comment thread hack/tools/go.mod Outdated
@BenTheElder
Copy link
Copy Markdown
Member

something broke badly with a number of the actions, we're going to have to get that fixed

@BenTheElder
Copy link
Copy Markdown
Member

ok so it's the ones on 22.04, ip6tables is broken there

@BenTheElder
Copy link
Copy Markdown
Member

we can bypass the actions, they're not relevant to only bumping golangci-lint

I want to run it again now that .go-version is on 1.22 though
/test pull-kind-verify
/test pull-kind-test

@BenTheElder
Copy link
Copy Markdown
Member

BenTheElder commented Apr 29, 2025

@stmcginnis can you rebase (picks up actions fixes :/) and go mod tidy again? Thanks!

@stmcginnis
Copy link
Copy Markdown
Contributor Author

Sorry, this had dropped off my radar. Will get rebased and updated.

The Go 1.25 release reminded me of this. Saw this nice update in the release notes:

When the go command updates the go line in a go.mod or go.work file, it no longer adds a toolchain line specifying the command’s current version.

@stmcginnis stmcginnis changed the title Update golangci-lint to v2.0.2 Update golangci-lint to v2.3.1 Aug 13, 2025
@BenTheElder
Copy link
Copy Markdown
Member

When the go command updates the go line in a go.mod or go.work file, it no longer adds a toolchain line specifying the command’s current version.

Yeah! 🎉 , been waiting on this bug.

I think, it might even be something to consider soonish as 1.21+ becomes available in stable / LTS distros to leverage this, but we probably don't want it writing in the current version every time we touch go mod ...

@BenTheElder
Copy link
Copy Markdown
Member

we might have to hold a little on 1.25, runc for example can be slightly sensitive to go upgrades, I haven't checked into that yet

@BenTheElder
Copy link
Copy Markdown
Member

Kubernetes/Kubernetes is also still not updated, I do want to leverage 1.25 though 😅

We're going to have go keep an eye out for our controllers attempting to become cgroup aware in the weird nested cgroup environment 🙃

@stmcginnis
Copy link
Copy Markdown
Contributor Author

we might have to hold a little on 1.25

Is there a reason to hold on this until 1.25 is in use?

Golangci-lint has released a new major version that includes some
changes to how it is configured, along with the usual linter updates
that come with every release.

This updates the golangci-lint version we use to v2.11.3 (the current
latest release) and updates the config file to conform to the new
format. Also includes quite a few trivial updates to address the new
warnings from the updated linters.

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
@stmcginnis stmcginnis changed the title Update golangci-lint to v2.3.1 Update golangci-lint to v2.11.3 Mar 12, 2026
@BenTheElder
Copy link
Copy Markdown
Member

We're on 1.25 since that comment anyhow. We're not yet on 1.26

@BenTheElder
Copy link
Copy Markdown
Member

/test pull-kind-test pull-kind-verify

Comment thread pkg/internal/runtime/runtime.go
Copy link
Copy Markdown
Member

@BenTheElder BenTheElder 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
thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, stmcginnis

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:
  • OWNERS [BenTheElder,stmcginnis]

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 merged commit 5442e73 into kubernetes-sigs:main Mar 12, 2026
30 checks passed
@stmcginnis stmcginnis deleted the golangci-lint2 branch March 12, 2026 20:02
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. area/provider/docker Issues or PRs related to docker area/provider/nerdctl Issues or PRs related to nerdctl area/provider/podman Issues or PRs related to podman 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants