@@ -28,6 +28,8 @@ GO_BUILD_ARGS = \
28
28
-X '$(REPO ) /internal/version.KubernetesVersion=v$(K8S_VERSION ) ' \
29
29
-X '$(REPO ) /internal/version.ImageVersion=$(IMAGE_VERSION ) ' \
30
30
" \
31
+ # containers_image_openpgp for containers/image
32
+ GO_BUILD_TAGS = containers_image_openpgp
31
33
32
34
export GO111MODULE = on
33
35
export CGO_ENABLED = 0
@@ -39,7 +41,7 @@ export PATH := $(PWD)/$(BUILD_DIR):$(PWD)/$(TOOLS_DIR):$(PATH)
39
41
generate : build # Generate CLI docs and samples
40
42
rm -rf testdata
41
43
$(GO ) run ./hack/generate/cncf-maintainers/main.go
42
- $(GO ) run ./hack/generate/cli-doc/gen-cli-doc.go
44
+ $(GO ) run -tags= $( GO_BUILD_TAGS ) ./hack/generate/cli-doc/gen-cli-doc.go
43
45
$(GO ) run ./hack/generate/samples/generate_testdata.go
44
46
$(GO ) generate ./...
45
47
@@ -54,15 +56,15 @@ fix: ## Fixup files in the repo.
54
56
$(GO ) mod tidy
55
57
$(GO ) fmt ./...
56
58
make setup-lint
57
- $(TOOLS_DIR ) /golangci-lint run --fix
59
+ $(TOOLS_DIR ) /golangci-lint run --fix --build-tags $( GO_BUILD_TAGS )
58
60
59
61
.PHONY : setup-lint
60
62
setup-lint : # # Setup the lint
61
63
$(SCRIPTS_DIR ) /fetch golangci-lint 1.64.8
62
64
63
65
.PHONY : lint
64
66
lint : setup-lint # # Run the lint check
65
- $(TOOLS_DIR ) /golangci-lint run
67
+ $(TOOLS_DIR ) /golangci-lint run --build-tags $( GO_BUILD_TAGS )
66
68
67
69
68
70
.PHONY : clean
@@ -89,11 +91,11 @@ install: ## Install operator-sdk and helm-operator.
89
91
.PHONY : build
90
92
build : # # Build operator-sdk and helm-operator.
91
93
@mkdir -p $(BUILD_DIR )
92
- $(GO ) build $(GO_BUILD_ARGS ) -o $(BUILD_DIR ) ./cmd/{operator-sdk,helm-operator}
94
+ $(GO ) build $(GO_BUILD_ARGS ) -tags= $( GO_BUILD_TAGS ) - o $(BUILD_DIR ) ./cmd/{operator-sdk,helm-operator}
93
95
94
96
.PHONY : build/operator-sdk build/helm-operator
95
97
build/operator-sdk build/helm-operator :
96
- $(GO ) build $(GO_BUILD_ARGS ) -o $(BUILD_DIR ) /$(@F ) ./cmd/$(@F )
98
+ $(GO ) build $(GO_BUILD_ARGS ) -tags= $( GO_BUILD_TAGS ) - o $(BUILD_DIR ) /$(@F ) ./cmd/$(@F )
97
99
98
100
# Build scorecard binaries.
99
101
.PHONY : build/scorecard-test build/scorecard-test-kuttl build/custom-scorecard-tests
@@ -151,7 +153,7 @@ test-sanity: generate fix ## Test repo formatting, linting, etc.
151
153
git diff --exit-code # fast-fail if generate or fix produced changes
152
154
./hack/check-license.sh
153
155
./hack/check-error-log-msg-format.sh
154
- $(GO ) vet ./...
156
+ $(GO ) vet -tags= $( GO_BUILD_TAGS ) ./...
155
157
make setup-lint
156
158
make lint
157
159
git diff --exit-code # diff again to ensure other checks don't change repo
@@ -165,7 +167,7 @@ test-docs: ## Test doc links
165
167
.PHONY : test-unit
166
168
TEST_PKGS = $(shell $(GO ) list ./... | grep -v -E 'github.com/operator-framework/operator-sdk/test/')
167
169
test-unit : # # Run unit tests
168
- $(GO ) test -coverprofile=coverage.out -covermode=count -short $(TEST_PKGS )
170
+ $(GO ) test -tags= $( GO_BUILD_TAGS ) - coverprofile=coverage.out -covermode=count -short $(TEST_PKGS )
169
171
170
172
e2e_tests := test-e2e-go test-e2e-helm test-e2e-integration
171
173
e2e_targets := test-e2e $(e2e_tests )
0 commit comments