@@ -26,16 +26,14 @@ $(PROTOC):
26
26
null :=
27
27
space := $(null ) #
28
28
comma := ,
29
- # default to json1 for sqlite3
30
- TAGS := -tags= json1,containers_image_openpgp
29
+ # default to json1 for sqlite3 and containers_image_openpgp for containers/image
30
+ TAGS := json1,containers_image_openpgp
31
31
32
32
# Cluster to use for e2e testing
33
33
CLUSTER ?= ""
34
34
ifeq ($(CLUSTER ) , kind)
35
35
# add kind to the list of tags
36
- TAGS += kind
37
- # convert tag format from space to comma list
38
- TAGS := $(subst $(space ) ,$(comma ) ,$(strip $(TAGS ) ) )
36
+ TAGS := $(TAGS ) ,kind
39
37
endif
40
38
41
39
# -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64
@@ -49,12 +47,12 @@ endif
49
47
all : clean test build
50
48
51
49
$(CMDS ) :
52
- $(extra_env ) $(GO ) build $(extra_flags ) $(TAGS ) -o $@ ./cmd/$(notdir $@ )
50
+ $(extra_env ) $(GO ) build $(extra_flags ) -tags= $(TAGS ) -o $@ ./cmd/$(notdir $@ )
53
51
54
52
.PHONY : $(OPM )
55
53
$(OPM ) : opm_version_flags=-ldflags "-X '$(PKG ) /cmd/opm/version.gitCommit=$(GIT_COMMIT ) ' -X '$(PKG ) /cmd/opm/version.opmVersion=$(OPM_VERSION ) ' -X '$(PKG ) /cmd/opm/version.buildDate=$(BUILD_DATE ) '"
56
54
$(OPM ) :
57
- $(extra_env ) $(GO ) build $(opm_version_flags ) $(extra_flags ) $(TAGS ) -o $@ ./cmd/$(notdir $@ )
55
+ $(extra_env ) $(GO ) build $(opm_version_flags ) $(extra_flags ) -tags= $(TAGS ) -o $@ ./cmd/$(notdir $@ )
58
56
59
57
.PHONY : build
60
58
build : clean $(CMDS ) $(OPM )
@@ -63,8 +61,8 @@ build: clean $(CMDS) $(OPM)
63
61
cross : opm_version_flags=-ldflags "-X '$(PKG ) /cmd/opm/version.gitCommit=$(GIT_COMMIT ) ' -X '$(PKG ) /cmd/opm/version.opmVersion=$(OPM_VERSION ) ' -X '$(PKG ) /cmd/opm/version.buildDate=$(BUILD_DATE ) '"
64
62
cross :
65
63
ifeq ($(shell go env GOARCH) ,amd64)
66
- GOOS=darwin CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) $(TAGS) -o "bin/darwin-amd64-opm" --ldflags "-extld=o64-clang" ./cmd/opm
67
- GOOS=windows CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) $(TAGS) -o "bin/windows-amd64-opm" --ldflags "-extld=x86_64-w64-mingw32-gcc" -buildmode=exe ./cmd/opm
64
+ GOOS=darwin CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) -tags= $(TAGS) -o "bin/darwin-amd64-opm" --ldflags "-extld=o64-clang" ./cmd/opm
65
+ GOOS=windows CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) -tags= $(TAGS) -o "bin/windows-amd64-opm" --ldflags "-extld=x86_64-w64-mingw32-gcc" -buildmode=exe ./cmd/opm
68
66
endif
69
67
70
68
.PHONY : static
@@ -73,7 +71,7 @@ static: build
73
71
74
72
.PHONY : unit
75
73
unit :
76
- $(GO ) test -coverprofile=coverage.out --coverpkg=./... $(SPECIFIC_UNIT_TEST ) $(SPECIFIC_SKIP_UNIT_TEST ) $(TAGS ) $(TEST_RACE ) -count=1 ./pkg/... ./alpha/...
74
+ $(GO ) test -coverprofile=coverage.out --coverpkg=./... $(SPECIFIC_UNIT_TEST ) $(SPECIFIC_SKIP_UNIT_TEST ) -tags= $(TAGS ) $(TEST_RACE ) -count=1 ./pkg/... ./alpha/...
77
75
78
76
.PHONY : tidy
79
77
tidy :
@@ -102,10 +100,8 @@ image-upstream:
102
100
docker build -f upstream-example.Dockerfile .
103
101
104
102
.PHONY : lint
105
- # lint:
106
- # find . -type f -name '*.go' ! -name '*.pb.go' -print0 | xargs -0 goimports -w
107
103
lint : $(GOLANGCI_LINT )
108
- $(GOLANGCI_LINT ) run $(GOLANGCI_LINT_ARGS )
104
+ $(GOLANGCI_LINT ) run --build-tags= $( TAGS ) $(GOLANGCI_LINT_ARGS )
109
105
110
106
.PHONY : fix-lint
111
107
fix-lint : $(GOLANGCI_LINT )
@@ -133,7 +129,7 @@ clean:
133
129
134
130
.PHONY : e2e
135
131
e2e : $(GINKGO )
136
- $(GINKGO ) --v --randomize-all --progress --trace --randomize-suites --race $(if $(TEST ) ,-focus '$(TEST ) ') $(TAGS ) ./test/e2e -- $(if $(SKIPTLS ) ,-skip-tls-verify true) $(if $(USEHTTP ) ,-use-http true)
132
+ $(GINKGO ) --v --randomize-all --progress --trace --randomize-suites --race $(if $(TEST ) ,-focus '$(TEST ) ') -tags= $(TAGS ) ./test/e2e -- $(if $(SKIPTLS ) ,-skip-tls-verify true) $(if $(USEHTTP ) ,-use-http true)
137
133
138
134
.PHONY : release
139
135
export OPM_IMAGE_REPO ?= quay.io/operator-framework/opm
0 commit comments