From 8618c093692f753c0fad1a4ab00912e9f218872a Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 12 Jun 2019 13:52:50 -0400 Subject: [PATCH] opt out of module mode for builds --- hack/jenkins/benchmark-dockerized.sh | 5 +++++ hack/jenkins/test-dockerized.sh | 5 +++++ hack/lib/init.sh | 4 ++-- hack/make-rules/test.sh | 2 +- test/e2e_node/jenkins/e2e-node-jenkins.sh | 5 +++++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hack/jenkins/benchmark-dockerized.sh b/hack/jenkins/benchmark-dockerized.sh index e2ac3e64657..aa2d58deadc 100755 --- a/hack/jenkins/benchmark-dockerized.sh +++ b/hack/jenkins/benchmark-dockerized.sh @@ -38,6 +38,11 @@ retry() { export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH} +# Until all GOPATH references are removed from all build scripts as well, +# explicitly disable module mode to avoid picking up user-set GO111MODULE preferences. +# As individual scripts make use of go modules, they can explicitly set GO111MODULE=on +export GO111MODULE=off + go install k8s.io/kubernetes/vendor/github.com/cespare/prettybench go install k8s.io/kubernetes/vendor/gotest.tools/gotestsum diff --git a/hack/jenkins/test-dockerized.sh b/hack/jenkins/test-dockerized.sh index 8302264749c..c55b55284bd 100755 --- a/hack/jenkins/test-dockerized.sh +++ b/hack/jenkins/test-dockerized.sh @@ -37,6 +37,11 @@ retry() { export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH} +# Until all GOPATH references are removed from all build scripts as well, +# explicitly disable module mode to avoid picking up user-set GO111MODULE preferences. +# As individual scripts make use of go modules, they can explicitly set GO111MODULE=on +export GO111MODULE=off + go install k8s.io/kubernetes/vendor/gotest.tools/gotestsum # Enable the Go race detector. diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 4822dfe3745..dffbc01e113 100755 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -23,10 +23,10 @@ set -o pipefail unset CDPATH # Until all GOPATH references are removed from all build scripts as well, -# explicitly reset to auto mode to avoid picking up user-set GO111MODULE preferences. +# explicitly disable module mode to avoid picking up user-set GO111MODULE preferences. # As individual scripts (like hack/update-vendor.sh) make use of go modules, # they can explicitly set GO111MODULE=on -export GO111MODULE=auto +export GO111MODULE=off # The root of the build/dist directory KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index ec6ac1593ae..4dc755988df 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -250,7 +250,7 @@ produceJUnitXMLReport() { if ! command -v gotestsum >/dev/null 2>&1; then kube::log::error "gotestsum not found; please install with " \ - "go install k8s.io/kubernetes/vendor/gotest.tools/gotestsum" + "GO111MODULE=off go install k8s.io/kubernetes/vendor/gotest.tools/gotestsum" return fi gotestsum --junitfile "${junit_xml_filename}" --raw-command cat "${junit_filename_prefix}"*.stdout diff --git a/test/e2e_node/jenkins/e2e-node-jenkins.sh b/test/e2e_node/jenkins/e2e-node-jenkins.sh index cd2f2e46836..00a8a46db0d 100755 --- a/test/e2e_node/jenkins/e2e-node-jenkins.sh +++ b/test/e2e_node/jenkins/e2e-node-jenkins.sh @@ -28,6 +28,11 @@ set -x . "${1}" +# Until all GOPATH references are removed from all build scripts as well, +# explicitly disable module mode to avoid picking up user-set GO111MODULE preferences. +# As individual scripts make use of go modules, they can explicitly set GO111MODULE=on +export GO111MODULE=off + # indirectly generates test/e2e/generated/bindata.go too make generated_files