kubevirt/fix-goflags-overwrite.patch
2020-11-13 23:47:58 +00:00

36 lines
1.1 KiB
Diff

Don't overwrite user-provided GOFLAGS
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Index: kubevirt-0.35.0/hack/common.sh
===================================================================
--- kubevirt-0.35.0.orig/hack/common.sh
+++ kubevirt-0.35.0/hack/common.sh
@@ -4,7 +4,7 @@ if [ -f cluster-up/hack/common.sh ]; the
source cluster-up/hack/common.sh
fi
-export GOFLAGS=-mod=vendor
+export GOFLAGS="$GOFLAGS -mod=vendor"
KUBEVIRT_DIR="$(
cd "$(dirname "$BASH_SOURCE[0]")/../"
@@ -23,7 +23,7 @@ ARCHITECTURE=$(uname -m)
function build_func_tests() {
mkdir -p "${TESTS_OUT_DIR}/"
- GOPROXY=off GOFLAGS=-mod=vendor \
+ GOPROXY=off GOFLAGS="$GOFLAGS -mod=vendor" \
go test -c "${KUBEVIRT_DIR}/tests" -o "${TESTS_OUT_DIR}/tests.test"
}
@@ -62,7 +62,7 @@ function kubevirt_version() {
KUBEVIRT_VERSION="$(kubevirt_version)"
function go_build() {
- GOPROXY=off GOFLAGS=-mod=vendor go build "$@"
+ GOPROXY=off GOFLAGS="$GOFLAGS -mod=vendor" go build "$@"
}
# Use this environment variable to set a local path to a custom CA certificate for