Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 127e7ac

Browse files
committed
Disable go modules
go 1.13 by default enables go modules feature, where we use 'dep' tool for module/package dependency. Till we move to go modules disable(GO111MODULE=off) this.
1 parent b6c2a21 commit 127e7ac

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
GO=GOOS=linux GO111MODULE=off go
1617
IMPORT_PATH=github.com/intel/pmem-csi
1718
CMDS=pmem-csi-driver pmem-vgm pmem-ns-init
1819
TEST_CMDS=$(addsuffix -test,$(CMDS))
@@ -58,21 +59,21 @@ all: build
5859
# Build all binaries, including tests.
5960
# Must use the workaround from https://github.com/golang/go/issues/15513
6061
build: $(CMDS) $(TEST_CMDS)
61-
go test -run none ./pkg/... ./test/e2e
62+
$(GO) test -run none ./pkg/... ./test/e2e
6263

6364
# "make test" runs a variety of fast tests, including building all source code.
6465
# More tests are added elsewhere in this Makefile and test/test.make.
6566
test: build
6667

6768
# Build production binaries.
6869
$(CMDS):
69-
GOOS=linux go build -ldflags '-X github.com/intel/pmem-csi/pkg/$@.version=${VERSION}' -a -o ${OUTPUT_DIR}/$@ ./cmd/$@
70+
$(GO) build -ldflags '-X github.com/intel/pmem-csi/pkg/$@.version=${VERSION}' -a -o ${OUTPUT_DIR}/$@ ./cmd/$@
7071

7172
# Build a test binary that can be used instead of the normal one with
7273
# additional "-run" parameters. In contrast to the normal it then also
7374
# supports -test.coverprofile.
7475
$(TEST_CMDS): %-test:
75-
GOOS=linux go test --cover -covermode=atomic -c -coverpkg=./pkg/... -ldflags '-X github.com/intel/pmem-csi/pkg/$*.version=${VERSION}' -o ${OUTPUT_DIR}/$@ ./cmd/$*
76+
$(GO) test --cover -covermode=atomic -c -coverpkg=./pkg/... -ldflags '-X github.com/intel/pmem-csi/pkg/$*.version=${VERSION}' -o ${OUTPUT_DIR}/$@ ./cmd/$*
7677

7778
# The default is to refresh the base image once a day when building repeatedly.
7879
# This is achieved by passing a fake variable that changes its value once per day.
@@ -111,7 +112,7 @@ print-image-version:
111112
@ echo "$(IMAGE_VERSION)"
112113

113114
clean:
114-
go clean -r -x
115+
$(GO) clean -r -x
115116
-rm -rf $(OUTPUT_DIR)
116117

117118
.PHONY: all build test clean $(CMDS) $(TEST_CMDS)

test/test.make

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
TEST_CMD=go test
1+
TEST_CMD=$(GO) test
22
TEST_ARGS=$(IMPORT_PATH)/pkg/...
33
SUDO=$(shell [ $$(id -u) -eq 0 ] && echo env || echo sudo)
44

55
.PHONY: vet
66
test: vet
7-
go vet $(IMPORT_PATH)/pkg/...
7+
$(GO) vet $(IMPORT_PATH)/pkg/...
88

99
# Check resp. fix formatting.
1010
.PHONY: test_fmt fmt
@@ -60,7 +60,7 @@ RUNTIME_DEPS =
6060
# We use "go list" because it is readily available. A good replacement
6161
# would be godeps. We list dependencies recursively, not just the
6262
# direct dependencies.
63-
RUNTIME_DEPS += go list -f '{{ join .Deps "\n" }}' ./cmd/pmem-csi-driver |
63+
RUNTIME_DEPS += $(GO) list -f '{{ join .Deps "\n" }}' ./cmd/pmem-csi-driver |
6464

6565
# This focuses on packages that are not in Golang core.
6666
RUNTIME_DEPS += grep '^github.com/intel/pmem-csi/vendor/' |
@@ -120,7 +120,7 @@ RUN_E2E = KUBECONFIG=`pwd`/_work/$(CLUSTER)/kube.config \
120120
CLUSTER=$(CLUSTER) \
121121
TEST_DEPLOYMENTMODE=$(shell source test/test-config.sh; echo $$TEST_DEPLOYMENTMODE) \
122122
TEST_DEVICEMODE=$(shell source test/test-config.sh; echo $$TEST_DEVICEMODE) \
123-
go test -count=1 -timeout 0 -v ./test/e2e \
123+
$(GO) test -count=1 -timeout 0 -v ./test/e2e \
124124
-ginkgo.skip='$(subst $(space),|,$(TEST_E2E_SKIP))' \
125125
-ginkgo.focus='$(subst $(space),|,$(TEST_E2E_FOCUS))' \
126126
-report-dir=$(TEST_E2E_REPORT_DIR)
@@ -131,7 +131,7 @@ test_e2e: start
131131
.PHONY: run_tests
132132
test: run_tests run_device_manager_tests
133133
RUN_TESTS = TEST_WORK=$(abspath _work) \
134-
$(TEST_CMD) $(shell go list $(TEST_ARGS) | grep -v pmem-device-manager | sed -e 's;$(IMPORT_PATH);.;')
134+
$(TEST_CMD) $(shell $(GO) list $(TEST_ARGS) | grep -v pmem-device-manager | sed -e 's;$(IMPORT_PATH);.;')
135135
RUN_DM_TESTS = \
136136
$(TEST_CMD) ./pkg/pmem-device-manager -exec $(SUDO)
137137
run_tests: _work/pmem-ca/.ca-stamp _work/evil-ca/.ca-stamp
@@ -161,7 +161,7 @@ _work/gocovmerge-$(GOCOVMERGE_VERSION):
161161
cd $$tmpdir && \
162162
echo "module foo" >go.mod && \
163163
go get github.com/wadey/gocovmerge@$(GOCOVMERGE_VERSION) && \
164-
go build -o $(abspath $@) github.com/wadey/gocovmerge
164+
$(GO) build -o $(abspath $@) github.com/wadey/gocovmerge
165165
ln -sf $(@F) _work/gocovmerge
166166

167167
# This is a special target that runs unit and E2E testing and
@@ -189,10 +189,10 @@ _work/coverage.out: _work/gocovmerge-$(GOCOVMERGE_VERSION)
189189
$< _work/coverage/* >$@
190190

191191
_work/coverage.html: _work/coverage.out
192-
go tool cover -html $< -o $@
192+
$(G0) tool cover -html $< -o $@
193193

194194
_work/coverage.txt: _work/coverage.out
195-
go tool cover -func $< -o $@
195+
$(GO) tool cover -func $< -o $@
196196

197197
.PHONY: coverage
198198
coverage:

0 commit comments

Comments
 (0)