@@ -40,6 +40,10 @@ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
4040
4141VERIFY_TLS ?= true
4242
43+ # GOWORK
44+ GOWORK ?= off
45+ export GOWORK := $(GOWORK )
46+
4347# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
4448# You can enable this value if you would like to use SHA Based Digests
4549# To enable set flag to true
@@ -117,11 +121,17 @@ fmt: ## Run go fmt against code.
117121
118122.PHONY : vet
119123vet : # # Run go vet against code.
120- go vet ./...
124+ go vet ./... ./api/...
121125
122126.PHONY : test
123127test : manifests generate fmt vet envtest # # Run tests.
124- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " go test ./... -coverprofile cover.out
128+ KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " go test ./... ./api/... -coverprofile cover.out
129+
130+ .PHONY : gowork
131+ gowork : # # Generate go.work file to support our multi module repository
132+ test -f go.work || go work init
133+ go work use .
134+ go work use ./api
125135
126136# #@ Build
127137
@@ -135,7 +145,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
135145
136146.PHONY : docker-build
137147docker-build : test # # Build docker image with the manager.
138- podman build -t ${IMG} .
148+ podman build --build-arg GOWORK= $( GOWORK ) - t ${IMG} .
139149
140150.PHONY : docker-push
141151docker-push : # # Push docker image with the manager.
@@ -273,19 +283,25 @@ get-ci-tools:
273283# Run go fmt against code
274284gofmt : get-ci-tools
275285 $(CI_TOOLS_REPO_DIR ) /test-runner/gofmt.sh
286+ $(CI_TOOLS_REPO_DIR ) /test-runner/gofmt.sh ./api
276287
277288# Run go vet against code
278289govet : get-ci-tools
279290 $(CI_TOOLS_REPO_DIR ) /test-runner/govet.sh
291+ $(CI_TOOLS_REPO_DIR ) /test-runner/govet.sh ./api
280292
281293# Run go test against code
282294gotest : get-ci-tools
283295 $(CI_TOOLS_REPO_DIR ) /test-runner/gotest.sh
296+ $(CI_TOOLS_REPO_DIR ) /test-runner/gotest.sh ./api
284297
285298# Run golangci-lint test against code
286299golangci : get-ci-tools
287300 $(CI_TOOLS_REPO_DIR ) /test-runner/golangci.sh
301+ $(CI_TOOLS_REPO_DIR ) /test-runner/golangci.sh ./api
288302
289303# Run go lint against code
290304golint : get-ci-tools
291305 PATH=$(GOBIN ) :$(PATH ) ; $(CI_TOOLS_REPO_DIR ) /test-runner/golint.sh
306+ PATH=$(GOBIN ) :$(PATH ) ; $(CI_TOOLS_REPO_DIR ) /test-runner/golint.sh ./api
307+
0 commit comments