From 3ed753a4d93def28101bd7e3ff51165cb9fd0b89 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 22 Sep 2019 16:59:56 -0300 Subject: [PATCH] Disable go modules --- Makefile | 8 ++++++-- build/build-plugin.sh | 2 ++ build/cover.sh | 2 ++ build/run-in-docker.sh | 1 + build/test.sh | 2 ++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fc2af18a1c..3e81bca2b7 100644 --- a/Makefile +++ b/Makefile @@ -58,11 +58,15 @@ GOOS = linux MULTI_ARCH_IMAGE = $(REGISTRY)/nginx-ingress-controller-${ARCH} +# use vendor directory instead of go modules https://github.com/golang/go/wiki/Modules +GO111MODULE=off + export ARCH export TAG export PKG export GOARCH export GOOS +export GO111MODULE export GIT_COMMIT export GOBUILD_FLAGS export REPO_INFO @@ -202,9 +206,9 @@ check_dead_links: .PHONY: dep-ensure dep-ensure: - GO111MODULE=on go mod tidy -v + go mod tidy -v find vendor -name '*_test.go' -delete - GO111MODULE=on go mod vendor + go mod vendor .PHONY: dev-env dev-env: diff --git a/build/build-plugin.sh b/build/build-plugin.sh index 6d0de4c01b..a1e116fb30 100755 --- a/build/build-plugin.sh +++ b/build/build-plugin.sh @@ -44,6 +44,8 @@ if [ "$missing" = true ]; then fi export CGO_ENABLED=0 +# use vendor directory instead of go modules https://github.com/golang/go/wiki/Modules +export GO111MODULE=off release=cmd/plugin/release diff --git a/build/cover.sh b/build/cover.sh index 56b2476cb1..db50d3e520 100755 --- a/build/cover.sh +++ b/build/cover.sh @@ -29,6 +29,8 @@ fi export CGO_ENABLED=1 export GODEBUG=netdns=go+2 +# use vendor directory instead of go modules https://github.com/golang/go/wiki/Modules +export GO111MODULE=off rm -rf coverage.txt for d in $(go list "${PKG}/..." | grep -v vendor | grep -v '/test/e2e' | grep -v images); do diff --git a/build/run-in-docker.sh b/build/run-in-docker.sh index 28910c0487..2632acd2ac 100755 --- a/build/run-in-docker.sh +++ b/build/run-in-docker.sh @@ -53,6 +53,7 @@ docker run \ --rm \ ${DOCKER_OPTS} \ -e GOCACHE="/go/src/${PKG}/.cache" \ + -e GO111MODULE=off \ -v "${HOME}/.kube:${HOME}/.kube" \ -v "${KUBE_ROOT}:/go/src/${PKG}" \ -v "${KUBE_ROOT}/bin/${ARCH}:/go/bin/linux_${ARCH}" \ diff --git a/build/test.sh b/build/test.sh index 480d166719..83fa48da50 100755 --- a/build/test.sh +++ b/build/test.sh @@ -31,6 +31,8 @@ fi # enabled to use host dns resolver export CGO_ENABLED=1 export GODEBUG=netdns=go+2 +# use vendor directory instead of go modules https://github.com/golang/go/wiki/Modules +export GO111MODULE=off go test -v -race \ $(go list "${PKG}/..." | grep -v vendor | grep -v '/test/e2e' | grep -v images | grep -v "docs/examples")