-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Fetch go version using gimme if needed #115377
Conversation
definitely makes things easier. we should probably not get in the way of the local dev env as well (only warn them?) also not install something unless they explicitly ok us installing something in their env? |
that's my instinct as well... could make our CI jobs opt into this behavior, and indicate how to opt-into auto-version-setup in verify_go_version if people want it |
awesome, consistently using go1.20rc3 for all our non-e2e presubmits caught an issue in verify-typecheck running with go1.20rc3 that #114502 missed:
we already exclude some cgo things in the typecheck because the go type scanner can't reliably interpret it... added a commit to exclude error checking of stdlib packages, will open in a separate PR to merge ahead of #114502 |
273d091
to
092e647
Compare
I think we should consider opt-out. If you want a custom go toolchain you already need to override any of the dockerized bits. opt-out gives a smoother more reproducible developer experience for the 99% case. KIND has opt-out + it will just use the existing toolchain if the version is correct. |
I think the tricky part in k/k is aligning these knobs with the dockerized build bits. |
interesting... by changing nothing other than the .go-version, this was able to build with go1.20rc3 even in the e2e:
that's ... kind of awesome |
very cool @liggitt ! |
LGTM label has been added. Git tree hash: 08c4d15a33357bce71f6de844c3d4cf3df04cf81
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, liggitt 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 |
/hold cancel |
belated |
…377-upstream-release-1.24 Automated cherry pick of #115377: Fetch go version using gimme if needed
…377-upstream-release-1.26 Automated cherry pick of #115377: Fetch go version using gimme if needed
…377-upstream-release-1.25 Automated cherry pick of #115377: Fetch go version using gimme if needed
What type of PR is this?
/kind feature
What this PR does / why we need it:
Allows kube::golang::verify_go_version to choose a go version. Defaults to .go-version, can be overridden by GO_VERSION=1.x or skipped entirely with FORCE_HOST_GO=y
Copies approach taken by https://github.com/kubernetes-sigs/kind/blob/main/hack/build/setup-go.sh
xref kubernetes/test-infra#28310
Special notes for your reviewer:
Does this PR introduce a user-facing change?
/cc @dims @BenTheElder