@@ -85,6 +85,12 @@ get_versioned_variable () {
85
85
echo " $value "
86
86
}
87
87
88
+ # If we have a vendor directory, then use it. We must be careful to only
89
+ # use this for "make" invocations inside the project's repo itself because
90
+ # setting it globally can break other go usages (like "go get <some command>"
91
+ # which is disabled with GOFLAGS=-mod=vendor).
92
+ configvar GOFLAGS_VENDOR " $( [ -d vendor ] && echo ' -mod=vendor' ) " " Go flags for using the vendor directory"
93
+
88
94
# Go versions can be specified seperately for different tasks
89
95
# If the pre-installed Go is missing or a different
90
96
# version, the required version here will get installed
@@ -928,7 +934,7 @@ main () {
928
934
images=
929
935
if ${CSI_PROW_BUILD_JOB} ; then
930
936
# A successful build is required for testing.
931
- run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make all || die " 'make all' failed"
937
+ run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make all " GOFLAGS_VENDOR= ${GOFLAGS_VENDOR} " || die " 'make all' failed"
932
938
# We don't want test failures to prevent E2E testing below, because the failure
933
939
# might have been minor or unavoidable, for example when experimenting with
934
940
# changes in "release-tools" in a PR (that fails the "is release-tools unmodified"
@@ -938,13 +944,13 @@ main () {
938
944
warn " installing 'dep' failed, cannot test vendoring"
939
945
ret=1
940
946
fi
941
- if ! run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make -k test 2>&1 | make_test_to_junit; then
947
+ if ! run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make -k test " GOFLAGS_VENDOR= ${GOFLAGS_VENDOR} " 2>&1 | make_test_to_junit; then
942
948
warn " 'make test' failed, proceeding anyway"
943
949
ret=1
944
950
fi
945
951
fi
946
952
# Required for E2E testing.
947
- run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make container || die " 'make container' failed"
953
+ run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make container " GOFLAGS_VENDOR= ${GOFLAGS_VENDOR} " || die " 'make container' failed"
948
954
fi
949
955
950
956
if tests_need_kind; then
0 commit comments