kubernetes: fix build with go 1.21+

go1.21+ checks the GOTOOLCHAIN variable and will attempt
to validate/fetch the toolchain version requested.

That doesn't work in our environment, so we export the
variable as "local" to indicate that the build should trust
(and use) the local toolchain.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2024-03-04 20:22:53 +00:00
parent e11497bda2
commit 417cfa77c5

View File

@ -71,6 +71,11 @@ do_compile() {
export CC="${BUILD_CC}"
export LD="${BUILD_LD}"
# set the toolchain to local to avoid an attempted fetch of
# valiation by the build
# https://github.com/actions/setup-go/issues/420
export GOTOOLCHAIN="local"
# make generated_files GO="go" KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}"
# is replaced by:
# ./hack/update-codegen.sh