Skip to content

Commit

Permalink
Makefile: Simplify 'test' and 'run'targets a bit.
Browse files Browse the repository at this point in the history
This follows a recommendation on a previous PR:

#134 (comment)

Signed-off-by: Michael Adam <[email protected]>
  • Loading branch information
obnoxxx committed Sep 16, 2024
1 parent a19c532 commit e197b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
OPERATOR_NAMESPACE="$(shell echo $${OPERATOR_NAMESPACE:=$(NAMESPACE)})" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
OPERATOR_NAMESPACE="$${OPERATOR_NAMESPACE:=$(NAMESPACE)}" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
Expand All @@ -134,7 +134,7 @@ build: manifests generate fmt vet ## Build manager binary.

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
OPERATOR_NAMESPACE="$(shell echo $${OPERATOR_NAMESPACE:=$(NAMESPACE)})" go run ./cmd/main.go
OPERATOR_NAMESPACE="$${OPERATOR_NAMESPACE:=$(NAMESPACE)}" go run ./cmd/main.go

# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
Expand Down

0 comments on commit e197b23

Please sign in to comment.