Skip to content

Bump golangci-lint to the latest version (v2)#4377

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
erikgb:golangci-lint-v2
Jan 2, 2026
Merged

Bump golangci-lint to the latest version (v2)#4377
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
erikgb:golangci-lint-v2

Conversation

@erikgb
Copy link
Copy Markdown
Member

@erikgb erikgb commented Dec 20, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

In #4376 it is required to bump the minimum Go version to Go 1.25, and golangci-lint v1 does not support Go 1.25.

I used golangci-lint migrate to migrate the golangci-lint configuration and manually ported the comments from the existing configuration, as the migration tool removes comments. Some new errors were introduced by v2, but were easy to fix.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 20, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 20, 2025
@erikgb erikgb force-pushed the golangci-lint-v2 branch 2 times, most recently from ab9410d to 5ced3e5 Compare December 20, 2025 21:10
// Set up plaintext server.
lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", config.HTTPPort))
plc := net.ListenConfig{}
lis, err := plc.Listen(ctx, "tcp", fmt.Sprintf("0.0.0.0:%d", config.HTTPPort))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

out of my curiosity, was this a bug or a linter complain?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Everything in this PR is done to fix new linter complains. In this case, ListenConfig is introduced to add a Listen function accepting a context.

@rikatz
Copy link
Copy Markdown
Member

rikatz commented Dec 22, 2025

@erikgb overall lgtm, do you mind running a conformance test against one of the implementations with these changes just to be sure no behavior will be broken?

Thanks

@erikgb
Copy link
Copy Markdown
Member Author

erikgb commented Dec 22, 2025

@erikgb overall lgtm, do you mind running a conformance test against one of the implementations with these changes just to be sure no behavior will be broken?

Thanks

@rikatz, not sure how to run the test you are asking for. Isn't these test run by CI?

@rikatz
Copy link
Copy Markdown
Member

rikatz commented Dec 22, 2025

no, they are not. Because the majority of changes are made on conformance package, this is my bigger concern.

You can install Istio, Cilium, Envoy Gateway or any other implementation and run it locally it with something like:

go test ./conformance -run TestConformance -args     --gateway-class=eg     --supported-features=Gateway,HTTPRoute,BackendTLSPolicy --debug --run-test BackendTLSPolicy

but will you need to set the right test to run (eg. I was testing BackendTLSPolicy here) and the right supported-features

@erikgb
Copy link
Copy Markdown
Member Author

erikgb commented Dec 23, 2025

@rikatz, I am not sure if I am able to run these tests on my workstation, as it is set up in a wierd way (company laptop). Are you able to help? The lint fixes should be pretty safe, as I have done similar changes in multiple projects without issues.

Signed-off-by: Erik Godding Boye <egboye@gmail.com>
@erikgb
Copy link
Copy Markdown
Member Author

erikgb commented Jan 2, 2026

I have now tried to run these conformance tests, both on the upstream default branch and from this branch, but with no success. Errors are the same on both branches, so I am still fairly certain that the changes proposed in this PR don't break anything. My problems running the tests are certainly caused by something wrong in my local setup. I've tried both Traefik and Envoy Gateway. After spending dozens of hours on debugging this, I would really appreciate some help in running these tests, if it's required to get this PR merged. 🙏 And if running these tests is required to get changes merged, I frankly don't understand why none of the tests are run as part of CI. 🙅

@erikgb
Copy link
Copy Markdown
Member Author

erikgb commented Jan 2, 2026

/retest

Copy link
Copy Markdown
Member

@snorwin snorwin left a comment

Choose a reason for hiding this comment

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

Thanks @erikgb!

I was able to successfully run the conformance test using the Airlock Microgateway with the GATEWAY-HTTP profile (this does not cover the changes made in the gRPC echo server).

@rikatz
Copy link
Copy Markdown
Member

rikatz commented Jan 2, 2026

Tested locally the GRPC tests, after rebuilding the echo-basic image and using it on my tests, works fine.

Also all the migrations / fixes seems correct.

/lgtm
/approve

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

rikatz commented Jan 2, 2026

thanks @erikgb !

@robscott
Copy link
Copy Markdown
Member

robscott commented Jan 2, 2026

Thanks @erikgb!

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erikgb, rikatz, robscott, snorwin

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 Jan 2, 2026
@k8s-ci-robot k8s-ci-robot merged commit 8174882 into kubernetes-sigs:main Jan 2, 2026
20 of 21 checks passed
RoseWrightdev pushed a commit to RoseWrightdev/gateway-api that referenced this pull request Jan 8, 2026
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
@rikatz rikatz mentioned this pull request Jan 8, 2026
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. 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. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants