@@ -28,6 +28,8 @@ GO_BUILD_ARGS = \
2828 -X '$(REPO ) /internal/version.KubernetesVersion=v$(K8S_VERSION ) ' \
2929 -X '$(REPO ) /internal/version.ImageVersion=$(IMAGE_VERSION ) ' \
3030 " \
31+ # containers_image_openpgp for containers/image
32+ GO_BUILD_TAGS = containers_image_openpgp
3133
3234export GO111MODULE = on
3335export CGO_ENABLED = 0
@@ -39,7 +41,7 @@ export PATH := $(PWD)/$(BUILD_DIR):$(PWD)/$(TOOLS_DIR):$(PATH)
3941generate : build # Generate CLI docs and samples
4042 rm -rf testdata
4143 $(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
4345 $(GO ) run ./hack/generate/samples/generate_testdata.go
4446 $(GO ) generate ./...
4547
@@ -54,15 +56,15 @@ fix: ## Fixup files in the repo.
5456 $(GO ) mod tidy
5557 $(GO ) fmt ./...
5658 make setup-lint
57- $(TOOLS_DIR ) /golangci-lint run --fix
59+ $(TOOLS_DIR ) /golangci-lint run --fix --build-tags $( GO_BUILD_TAGS )
5860
5961.PHONY : setup-lint
6062setup-lint : # # Setup the lint
6163 $(SCRIPTS_DIR ) /fetch golangci-lint 1.64.8
6264
6365.PHONY : lint
6466lint : setup-lint # # Run the lint check
65- $(TOOLS_DIR ) /golangci-lint run
67+ $(TOOLS_DIR ) /golangci-lint run --build-tags $( GO_BUILD_TAGS )
6668
6769
6870.PHONY : clean
@@ -89,11 +91,11 @@ install: ## Install operator-sdk and helm-operator.
8991.PHONY : build
9092build : # # Build operator-sdk and helm-operator.
9193 @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}
9395
9496.PHONY : build/operator-sdk build/helm-operator
9597build/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 )
9799
98100# Build scorecard binaries.
99101.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.
151153 git diff --exit-code # fast-fail if generate or fix produced changes
152154 ./hack/check-license.sh
153155 ./hack/check-error-log-msg-format.sh
154- $(GO ) vet ./...
156+ $(GO ) vet -tags= $( GO_BUILD_TAGS ) ./...
155157 make setup-lint
156158 make lint
157159 git diff --exit-code # diff again to ensure other checks don't change repo
@@ -165,7 +167,7 @@ test-docs: ## Test doc links
165167.PHONY : test-unit
166168TEST_PKGS = $(shell $(GO ) list ./... | grep -v -E 'github.com/operator-framework/operator-sdk/test/')
167169test-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 )
169171
170172e2e_tests := test-e2e-go test-e2e-helm test-e2e-integration
171173e2e_targets := test-e2e $(e2e_tests )
0 commit comments