@@ -24,6 +24,8 @@ KIND_CLUSTER_NAME ?= operator-controller
2424
2525CONTAINER_RUNTIME ?= docker
2626
27+ KUSTOMIZE_BUILD_DIR ?= config/default
28+
2729# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
2830ifeq (,$(shell go env GOBIN) )
2931GOBIN =$(shell go env GOPATH) /bin
@@ -103,7 +105,14 @@ test-unit: $(SETUP_ENVTEST) ## Run the unit tests
103105 eval $$($(SETUP_ENVTEST ) use -p env $(ENVTEST_VERSION ) ) && go test -tags $(GO_BUILD_TAGS ) -count=1 -short $(UNIT_TEST_DIRS ) -coverprofile cover.out
104106
105107e2e : KIND_CLUSTER_NAME=operator-controller-e2e
106- e2e : run kind-load-test-artifacts test-e2e kind-cluster-cleanup # # Run e2e test suite on local kind cluster
108+ e2e : KUSTOMIZE_BUILD_DIR=config/e2e
109+ e2e : GO_BUILD_FLAGS=-cover
110+ e2e : run kind-load-test-artifacts test-e2e e2e-coverage
111+ @$(MAKE ) kind-cluster-cleanup KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME )
112+
113+ .PHONY : e2e-coverage
114+ e2e-coverage :
115+ COVERAGE_OUTPUT=./e2e-cover.out ./hack/e2e-coverage.sh
107116
108117kind-load : $(KIND ) # # Loads the currently constructed image onto the cluster
109118 $(KIND ) load docker-image $(IMG ) --name $(KIND_CLUSTER_NAME )
@@ -115,6 +124,7 @@ kind-cluster: $(KIND) kind-cluster-cleanup ## Standup a kind cluster
115124kind-cluster-cleanup : $(KIND ) # # Delete the kind cluster
116125 $(KIND ) delete cluster --name ${KIND_CLUSTER_NAME}
117126
127+ .PHONY : kind-load-test-artifacts
118128kind-load-test-artifacts : $(KIND ) # # Load the e2e testdata container images into a kind cluster
119129 $(CONTAINER_RUNTIME ) build $(TESTDATA_DIR ) /bundles/registry-v1/prometheus-operator.v0.47.0 -t localhost/testdata/bundles/registry-v1/prometheus-operator:v0.47.0
120130 $(CONTAINER_RUNTIME ) build $(TESTDATA_DIR ) /bundles/plain-v0/plain.v0.1.0 -t localhost/testdata/bundles/plain-v0/plain:v0.1.0
@@ -174,7 +184,7 @@ release: $(GORELEASER) ## Runs goreleaser for the operator-controller. By defaul
174184
175185quickstart : export MANIFEST="https://github.com/operator-framework/operator-controller/releases/download/$(VERSION ) /operator-controller.yaml"
176186quickstart : $(KUSTOMIZE ) generate # # Generate the installation release manifests and scripts
177- $(KUSTOMIZE ) build config/default | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
187+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
178188 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh
179189
180190# #@ Deployment
@@ -186,7 +196,7 @@ endif
186196.PHONY : install
187197install : export MANIFEST="./operator-controller.yaml"
188198install : manifests $(KUSTOMIZE ) generate # # Install CRDs into the K8s cluster specified in ~/.kube/config.
189- $(KUSTOMIZE ) build config/default > operator-controller.yaml
199+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) > operator-controller.yaml
190200 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s
191201
192202.PHONY : uninstall
@@ -196,8 +206,8 @@ uninstall: manifests $(KUSTOMIZE) ## Uninstall CRDs from the K8s cluster specifi
196206.PHONY : deploy
197207deploy : manifests $(KUSTOMIZE ) # # Deploy controller to the K8s cluster specified in ~/.kube/config.
198208 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
199- $(KUSTOMIZE ) build config/default | kubectl apply -f -
209+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl apply -f -
200210
201211.PHONY : undeploy
202212undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
203- $(KUSTOMIZE ) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
213+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
0 commit comments