Skip to content

Commit 429581c

Browse files
committed
prow.sh: pull Go version from travis.yml
The travis.yml is now the only place where the Go version for the component itself needs to be configured.
1 parent 0a0fd49 commit 429581c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

prow.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
# - kind (https://github.com/kubernetes-sigs/kind) installed
4040
# - optional: Go already installed
4141

42+
RELEASE_TOOLS_ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
43+
REPO_DIR="$(pwd)"
44+
4245
# Sets the default value for a variable if not set already and logs the value.
4346
# Any variable set this way is usually something that a repo's .prow.sh
4447
# or the job can set.
@@ -53,7 +56,10 @@ configvar () {
5356
# If the pre-installed Go is missing or a different
5457
# version, the required version here will get installed
5558
# from https://golang.org/dl/.
56-
configvar CSI_PROW_GO_VERSION_BUILD 1.11.4 "Go version for building the component" # depends on component's source code
59+
go_from_travis_yml () {
60+
grep "^ *- go:" "${RELEASE_TOOLS_ROOT}/travis.yml" | sed -e 's/.*go: *//'
61+
}
62+
configvar CSI_PROW_GO_VERSION_BUILD "$(go_from_travis_yml)" "Go version for building the component" # depends on component's source code
5763
configvar CSI_PROW_GO_VERSION_K8S 1.12.1 "Go version for building Kubernetes for the test cluster" # depends on Kubernetes version
5864
configvar CSI_PROW_GO_VERSION_E2E 1.12.1 "Go version for building the Kubernetes E2E test suite" # depends on CSI_PROW_E2E settings below
5965
configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below
@@ -262,9 +268,6 @@ configvar CSI_PROW_E2E_SKIP 'while.kubelet.is.down.*Disruptive' "tests that need
262268
configvar ARTIFACTS "${CSI_PROW_WORK}/artifacts" "artifacts"
263269
mkdir -p "${ARTIFACTS}"
264270

265-
RELEASE_TOOLS_ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
266-
REPO_DIR="$(pwd)"
267-
268271
run () {
269272
echo "$(date) $(go version | sed -e 's/.*version \(go[^ ]*\).*/\1/') $(if [ "$(pwd)" != "${REPO_DIR}" ]; then pwd; fi)\$" "$@" >&2
270273
"$@"

0 commit comments

Comments
 (0)