@@ -100,15 +100,15 @@ help-extended: #HELP Display extended help.
100
100
101
101
.PHONY : lint
102
102
lint : lint-custom $(GOLANGCI_LINT ) # HELP Run golangci linter.
103
- $(GOLANGCI_LINT ) run --build-tags $( GO_BUILD_TAGS ) $(GOLANGCI_LINT_ARGS )
103
+ $(GOLANGCI_LINT ) run $(GOLANGCI_LINT_ARGS )
104
104
105
105
.PHONY : custom-linter-build
106
106
custom-linter-build : # HELP Build custom linter
107
- go build -tags $( GO_BUILD_TAGS ) - o ./bin/custom-linter ./hack/ci/custom-linters/cmd
107
+ go build -o ./bin/custom-linter ./hack/ci/custom-linters/cmd
108
108
109
109
.PHONY : lint-custom
110
110
lint-custom : custom-linter-build # HELP Call custom linter for the project
111
- go vet -tags= $( GO_BUILD_TAGS ) - vettool=./bin/custom-linter ./...
111
+ go vet -vettool=./bin/custom-linter ./...
112
112
113
113
.PHONY : tidy
114
114
tidy : # HELP Update dependencies.
@@ -138,7 +138,7 @@ verify: tidy fmt generate manifests crd-ref-docs #HELP Verify all generated code
138
138
139
139
.PHONY : fix-lint
140
140
fix-lint : $(GOLANGCI_LINT ) # EXHELP Fix lint issues
141
- $(GOLANGCI_LINT ) run --fix --build-tags $( GO_BUILD_TAGS ) $(GOLANGCI_LINT_ARGS )
141
+ $(GOLANGCI_LINT ) run --fix $(GOLANGCI_LINT_ARGS )
142
142
143
143
.PHONY : fmt
144
144
fmt : # EXHELP Formats code
@@ -197,7 +197,6 @@ test-unit: $(SETUP_ENVTEST) envtest-k8s-bins #HELP Run the unit tests
197
197
rm -rf $(COVERAGE_UNIT_DIR ) && mkdir -p $(COVERAGE_UNIT_DIR )
198
198
KUBEBUILDER_ASSETS=" $( shell $( SETUP_ENVTEST) use -p path $( ENVTEST_VERSION) $( SETUP_ENVTEST_BIN_DIR_OVERRIDE) ) " \
199
199
CGO_ENABLED =1 go test \
200
- -tags '$(GO_BUILD_TAGS ) ' \
201
200
-cover -coverprofile ${ROOT_DIR}/coverage/unit.out \
202
201
-count=1 -race -short \
203
202
$(UNIT_TEST_DIRS ) \
@@ -208,8 +207,8 @@ E2E_REGISTRY_IMAGE=localhost/e2e-test-registry:devel
208
207
image-registry : export GOOS=linux
209
208
image-registry : export GOARCH=amd64
210
209
image-registry : # # Build the testdata catalog used for e2e tests and push it to the image registry
211
- 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
212
- 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
210
+ 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
211
+ 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
213
212
$(CONTAINER_RUNTIME ) build -f ./testdata/Dockerfile -t $(E2E_REGISTRY_IMAGE ) ./testdata
214
213
$(CONTAINER_RUNTIME ) save $(E2E_REGISTRY_IMAGE ) | $(KIND ) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME )
215
214
./testdata/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE ) $(E2E_REGISTRY_NAME ) $(E2E_REGISTRY_IMAGE )
@@ -317,10 +316,12 @@ export GO_BUILD_FLAGS :=
317
316
export GO_BUILD_LDFLAGS := -s -w \
318
317
-X '$(VERSION_PATH ) .version=$(VERSION ) ' \
319
318
319
+ export GOFLAGS := "-tags=$(GO_BUILD_TAGS ) "
320
+
320
321
BINARIES =operator-controller
321
322
322
323
$(BINARIES ) :
323
- go build $(GO_BUILD_FLAGS ) -tags ' $(GO_BUILD_TAGS) ' - ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN ) /$@ ./cmd/$@
324
+ go build $(GO_BUILD_FLAGS ) -ldflags ' $(GO_BUILD_LDFLAGS)' -gcflags ' $(GO_BUILD_GCFLAGS)' -asmflags ' $(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN ) /$@ ./cmd/$@
324
325
325
326
.PHONY : build-deps
326
327
build-deps : manifests generate fmt
0 commit comments