PSA: CI (prow.k8s.io) Change: GOTOOLCHAIN=auto set by default

33 views
Skip to first unread message

Benjamin Elder

unread,
Mar 12, 2026, 12:40:11 PM (5 days ago) Mar 12
to dev
Hello Kubernetes Contributors! If you don't maintain CI jobs on prow you can stop reading now.

====================================

For those of you who maintain CI jobs: We're rolling out a default preset of env `GOTOOLCHAIN=auto`. The short version is that this will match local `go` behavior and ensure Go toolchain version selection is automatic based on the module configuration in your repository.

https://github.com/kubernetes/test-infra/pull/36644

If you aren't explicitly expecting `GOTOOLCHAIN=local`, you shouldn't need to worry about this, and consider the verbose details below as an FYI for the future.

I expect this to be a no-op or a strict improvement for ~all of CI. This PSA is precautionary.

====================================

More detail:

Project-owned CI images should generally already set `GOTOOLCHAIN=auto` within the image, however images derived from recent golang images on Docker Hub will have `GOTOOLCHAIN=local`.

GOTOOLCHAIN=local ensures that the **exact** Go version contained in the image is used rather than the version implied/specified by the Go module. This means that to update Go you must modify the CI configuration, and then hope it works the next time you run CI.

Instead, you can now use:
- gotoolchain statement in your go.mod in your repo under test
- go language version in your go.mod in your repo under test

And in both cases you can use:
- GOTOOLCHAIN environment variable in your scripts / makefiles (e.g. Kubernetes/Kubernetes does this with the custom .go-version file), preferably in your repo under test

If you *explicitly* want the CI configuration to control your GOTOOLCHAIN version, just prepend `GOTOOLCHAIN=local` to your CI job's command.

Feel free to ping me with any questions.
- Ben / bentheelder@ (slack, github, @google.com)
Reply all
Reply to author
Forward
0 new messages