From 3124a13587c7710914426bc4de368ca440ffe056 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 26 Sep 2024 22:47:43 +0200 Subject: [PATCH] hack: configure Go environments where necessary These scripts rely on the system's default go; this changes that using kube::golang::setup_env so that the appropriate go is used when the system's isn't sufficient. Signed-off-by: Stephen Kitt --- hack/verify-featuregates.sh | 2 ++ hack/verify-testing-import.sh | 2 ++ test/conformance/spec-to-yaml.sh | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/hack/verify-featuregates.sh b/hack/verify-featuregates.sh index 6aaf748ad1e..7662606ca87 100755 --- a/hack/verify-featuregates.sh +++ b/hack/verify-featuregates.sh @@ -26,6 +26,8 @@ set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" +kube::golang::setup_env + cd "${KUBE_ROOT}" go run test/featuregates_linter/main.go feature-gates verify diff --git a/hack/verify-testing-import.sh b/hack/verify-testing-import.sh index b13b2a903b3..addc10f1b84 100755 --- a/hack/verify-testing-import.sh +++ b/hack/verify-testing-import.sh @@ -28,6 +28,8 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" cd "${KUBE_ROOT}" +kube::golang::setup_env + RELEASE_BIN_PKGS=( "${KUBE_ROOT}/cmd/cloud-controller-manager" "${KUBE_ROOT}/cmd/kube-apiserver" diff --git a/test/conformance/spec-to-yaml.sh b/test/conformance/spec-to-yaml.sh index d9ecc5ec26e..6294653fb58 100755 --- a/test/conformance/spec-to-yaml.sh +++ b/test/conformance/spec-to-yaml.sh @@ -22,5 +22,9 @@ set -o pipefail KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P) cd "${KUBE_ROOT}" +source "${KUBE_ROOT}/hack/lib/init.sh" + +kube::golang::setup_env + # convert dumped spec (see dump-spec.sh) to conformance.yaml go run ./test/conformance/walk.go --source="${KUBE_ROOT}" ./_output/specsummaries.json > ./_output/conformance.yaml