@@ -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,13 @@ 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 kind-cluster-cleanup # # Run e2e test suite on local kind cluster
111+
112+ .PHONY : e2e-coverage
113+ e2e-coverage :
114+ COVERAGE_OUTPUT=./e2e-cover.out ./hack/e2e-coverage.sh
107115
108116kind-load : $(KIND ) # # Loads the currently constructed image onto the cluster
109117 $(KIND ) load docker-image $(IMG ) --name $(KIND_CLUSTER_NAME )
@@ -115,6 +123,7 @@ kind-cluster: $(KIND) kind-cluster-cleanup ## Standup a kind cluster
115123kind-cluster-cleanup : $(KIND ) # # Delete the kind cluster
116124 $(KIND ) delete cluster --name ${KIND_CLUSTER_NAME}
117125
126+ .PHONY : kind-load-test-artifacts
118127kind-load-test-artifacts : $(KIND ) # # Load the e2e testdata container images into a kind cluster
119128 $(CONTAINER_RUNTIME ) build $(TESTDATA_DIR ) /bundles/registry-v1/prometheus-operator.v0.47.0 -t localhost/testdata/bundles/registry-v1/prometheus-operator:v0.47.0
120129 $(CONTAINER_RUNTIME ) build $(TESTDATA_DIR ) /bundles/plain-v0/plain.v0.1.0 -t localhost/testdata/bundles/plain-v0/plain:v0.1.0
@@ -174,7 +183,7 @@ release: $(GORELEASER) ## Runs goreleaser for the operator-controller. By defaul
174183
175184quickstart : export MANIFEST="https://github.com/operator-framework/operator-controller/releases/download/$(VERSION ) /operator-controller.yaml"
176185quickstart : $(KUSTOMIZE ) generate # # Generate the installation release manifests and scripts
177- $(KUSTOMIZE ) build config/default | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
186+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
178187 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh
179188
180189# #@ Deployment
@@ -186,7 +195,7 @@ endif
186195.PHONY : install
187196install : export MANIFEST="./operator-controller.yaml"
188197install : manifests $(KUSTOMIZE ) generate # # Install CRDs into the K8s cluster specified in ~/.kube/config.
189- $(KUSTOMIZE ) build config/default > operator-controller.yaml
198+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) > operator-controller.yaml
190199 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s
191200
192201.PHONY : uninstall
@@ -196,8 +205,8 @@ uninstall: manifests $(KUSTOMIZE) ## Uninstall CRDs from the K8s cluster specifi
196205.PHONY : deploy
197206deploy : manifests $(KUSTOMIZE ) # # Deploy controller to the K8s cluster specified in ~/.kube/config.
198207 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
199- $(KUSTOMIZE ) build config/default | kubectl apply -f -
208+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl apply -f -
200209
201210.PHONY : undeploy
202211undeploy : # # 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 -
212+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
0 commit comments