From 9cec273d84a5fd310fe54be7b7a858f0d5aeb53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Wed, 11 Dec 2024 00:33:59 +0800 Subject: [PATCH] Set GOMODCACHE to avoid re-download toolchain If we don't set this, k/k build script will set GOMODCACHE different from default, and re-download the toolchain (or fail to build for Kubernetes <= 1.29). --- prow.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prow.sh b/prow.sh index 7124b401..67d8dfb2 100755 --- a/prow.sh +++ b/prow.sh @@ -441,7 +441,8 @@ run_with_go () { else version=local fi - GOTOOLCHAIN=$version run "$@" + # Set GOMODCACHE to make sure Kubernetes does not need to download again. + GOTOOLCHAIN=$version GOMODCACHE="$(go env GOMODCACHE)" run "$@" } # Ensure that we have the desired version of kind.