@@ -26,16 +26,14 @@ $(PROTOC):
2626null :=
2727space := $(null ) #
2828comma := ,
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
3131
3232# Cluster to use for e2e testing
3333CLUSTER ?= ""
3434ifeq ($(CLUSTER ) , kind)
3535# 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
3937endif
4038
4139# -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
4947all : clean test build
5048
5149$(CMDS ) :
52- $(extra_env ) $(GO ) build $(extra_flags ) $(TAGS ) -o $@ ./cmd/$(notdir $@ )
50+ $(extra_env ) $(GO ) build $(extra_flags ) -tags= $(TAGS ) -o $@ ./cmd/$(notdir $@ )
5351
5452.PHONY : $(OPM )
5553$(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 ) '"
5654$(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 $@ )
5856
5957.PHONY : build
6058build : clean $(CMDS ) $(OPM )
@@ -63,8 +61,8 @@ build: clean $(CMDS) $(OPM)
6361cross : 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 ) '"
6462cross :
6563ifeq ($(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
6866endif
6967
7068.PHONY : static
@@ -73,7 +71,7 @@ static: build
7371
7472.PHONY : unit
7573unit :
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/...
7775
7876.PHONY : tidy
7977tidy :
@@ -102,8 +100,7 @@ image-upstream:
102100 docker build -f upstream-example.Dockerfile .
103101
104102.PHONY : lint
105- # lint:
106- # find . -type f -name '*.go' ! -name '*.pb.go' -print0 | xargs -0 goimports -w
103+ GOLANGCI_LINT_ARGS := --build-tags=$(TAGS )
107104lint : $(GOLANGCI_LINT )
108105 $(GOLANGCI_LINT ) run $(GOLANGCI_LINT_ARGS )
109106
@@ -133,7 +130,7 @@ clean:
133130
134131.PHONY : e2e
135132e2e : $(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)
133+ $(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)
137134
138135.PHONY : release
139136export OPM_IMAGE_REPO ?= quay.io/operator-framework/opm
0 commit comments