@@ -102,15 +102,15 @@ help-extended: #HELP Display extended help.
102
102
103
103
.PHONY : lint
104
104
lint : lint-custom $(GOLANGCI_LINT ) # HELP Run golangci linter.
105
- $(GOLANGCI_LINT ) run --build-tags $( GO_BUILD_TAGS ) $(GOLANGCI_LINT_ARGS )
105
+ $(GOLANGCI_LINT ) run $(GOLANGCI_LINT_ARGS )
106
106
107
107
.PHONY : custom-linter-build
108
108
custom-linter-build : # EXHELP Build custom linter
109
- go build -tags $( GO_BUILD_TAGS ) - o ./bin/custom-linter ./hack/ci/custom-linters/cmd
109
+ go build -o ./bin/custom-linter ./hack/ci/custom-linters/cmd
110
110
111
111
.PHONY : lint-custom
112
112
lint-custom : custom-linter-build # EXHELP Call custom linter for the project
113
- go vet -tags= $( GO_BUILD_TAGS ) - vettool=./bin/custom-linter ./...
113
+ go vet -vettool=./bin/custom-linter ./...
114
114
115
115
.PHONY : tidy
116
116
tidy : # HELP Update dependencies.
@@ -148,7 +148,7 @@ verify: tidy fmt generate manifests crd-ref-docs #HELP Verify all generated code
148
148
149
149
.PHONY : fix-lint
150
150
fix-lint : $(GOLANGCI_LINT ) # EXHELP Fix lint issues
151
- $(GOLANGCI_LINT ) run --fix --build-tags $( GO_BUILD_TAGS ) $(GOLANGCI_LINT_ARGS )
151
+ $(GOLANGCI_LINT ) run --fix $(GOLANGCI_LINT_ARGS )
152
152
153
153
.PHONY : fmt
154
154
fmt : # EXHELP Formats code
@@ -208,7 +208,6 @@ test-unit: $(SETUP_ENVTEST) envtest-k8s-bins #HELP Run the unit tests
208
208
rm -rf $(COVERAGE_UNIT_DIR ) && mkdir -p $(COVERAGE_UNIT_DIR )
209
209
KUBEBUILDER_ASSETS=" $( shell $( SETUP_ENVTEST) use -p path $( ENVTEST_VERSION) $( SETUP_ENVTEST_BIN_DIR_OVERRIDE) ) " \
210
210
CGO_ENABLED =1 go test \
211
- -tags '$(GO_BUILD_TAGS ) ' \
212
211
-cover -coverprofile ${ROOT_DIR}/coverage/unit.out \
213
212
-count=1 -race -short \
214
213
$(UNIT_TEST_DIRS ) \
@@ -219,8 +218,8 @@ E2E_REGISTRY_IMAGE=localhost/e2e-test-registry:devel
219
218
image-registry : export GOOS=linux
220
219
image-registry : export GOARCH=amd64
221
220
image-registry : # # Build the testdata catalog used for e2e tests and push it to the image registry
222
- go build $(GO_BUILD_FLAGS ) -tags ' $(GO_BUILD_TAGS) ' - ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o ./testdata/registry/bin/registry ./testdata/registry/registry.go
223
- go build $(GO_BUILD_FLAGS ) -tags ' $(GO_BUILD_TAGS) ' - ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o ./testdata/push/bin/push ./testdata/push/push.go
221
+ go build $(GO_BUILD_FLAGS ) -ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o ./testdata/registry/bin/registry ./testdata/registry/registry.go
222
+ go build $(GO_BUILD_FLAGS ) -ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o ./testdata/push/bin/push ./testdata/push/push.go
224
223
$(CONTAINER_RUNTIME ) build -f ./testdata/Dockerfile -t $(E2E_REGISTRY_IMAGE ) ./testdata
225
224
$(CONTAINER_RUNTIME ) save $(E2E_REGISTRY_IMAGE ) | $(KIND ) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME )
226
225
./testdata/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE ) $(E2E_REGISTRY_NAME ) $(E2E_REGISTRY_IMAGE )
@@ -309,11 +308,12 @@ export GO_BUILD_FLAGS :=
309
308
export GO_BUILD_LDFLAGS := -s -w \
310
309
-X '$(VERSION_PATH ) .version=$(VERSION ) ' \
311
310
311
+ export GOFLAGS := "-tags=$(GO_BUILD_TAGS ) "
312
312
BINARIES =operator-controller catalogd
313
313
314
314
.PHONY : $(BINARIES )
315
315
$(BINARIES ) :
316
- go build $(GO_BUILD_FLAGS ) -tags ' $(GO_BUILD_TAGS) ' - ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN ) /$@ ./cmd/$@
316
+ go build $(GO_BUILD_FLAGS ) -ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN ) /$@ ./cmd/$@
317
317
318
318
.PHONY : build-deps
319
319
build-deps : manifests generate fmt
0 commit comments