Skip to content

Commit caec04f

Browse files
committed
add containers_image_openpgp build tag
Signed-off-by: Joe Lanford <[email protected]>
1 parent bb96323 commit caec04f

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

Makefile

+10-14
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ $(PROTOC):
2626
null :=
2727
space := $(null) #
2828
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
3131

3232
# Cluster to use for e2e testing
3333
CLUSTER ?= ""
3434
ifeq ($(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
3937
endif
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
4947
all: 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
6058
build: clean $(CMDS) $(OPM)
@@ -63,8 +61,8 @@ build: clean $(CMDS) $(OPM)
6361
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)'"
6462
cross:
6563
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
6866
endif
6967

7068
.PHONY: static
@@ -73,7 +71,7 @@ static: build
7371

7472
.PHONY: unit
7573
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/...
7775

7876
.PHONY: tidy
7977
tidy:
@@ -102,10 +100,8 @@ 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
107103
lint: $(GOLANGCI_LINT)
108-
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_ARGS)
104+
$(GOLANGCI_LINT) run --build-tags=$(TAGS) $(GOLANGCI_LINT_ARGS)
109105

110106
.PHONY: fix-lint
111107
fix-lint: $(GOLANGCI_LINT)
@@ -133,7 +129,7 @@ clean:
133129

134130
.PHONY: e2e
135131
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)
137133

138134
.PHONY: release
139135
export OPM_IMAGE_REPO ?= quay.io/operator-framework/opm

release/goreleaser.darwin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ builds:
1010
- CGO_ENABLED=1
1111
mod_timestamp: "{{ .CommitTimestamp }}"
1212
flags: &build-flags
13-
- -tags=json1
13+
- -tags=json1,containers_image_openpgp
1414
asmflags: &build-asmflags
1515
- all=-trimpath={{ .Env.PWD }}
1616
gcflags: &build-gcflags

release/goreleaser.linux.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ builds:
1111
- CGO_ENABLED=1
1212
mod_timestamp: "{{ .CommitTimestamp }}"
1313
flags: &build-flags
14-
- -tags=json1,netgo,osusergo
14+
- -tags=json1,netgo,osusergo,containers_image_openpgp
1515
asmflags: &build-asmflags
1616
- all=-trimpath={{ .Env.PWD }}
1717
gcflags: &build-gcflags

release/goreleaser.windows.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ builds:
1010
- CGO_ENABLED=1
1111
mod_timestamp: "{{ .CommitTimestamp }}"
1212
flags: &build-flags
13-
- -tags=json1,netgo,osusergo
13+
- -tags=json1,netgo,osusergo,containers_image_openpgp
1414
asmflags: &build-asmflags
1515
- all=-trimpath={{ .Env.PWD }}
1616
gcflags: &build-gcflags

0 commit comments

Comments
 (0)