@@ -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
108+ e2e : KUSTOMIZE_BUILD_DIR=config/e2e
106109e2e : run kind-load-test-artifacts test-e2e kind-cluster-cleanup # # Run e2e test suite on local kind cluster
110+ kubectl -n $(OPERATOR_CONTROLLER_NAMESPACE ) scale deployment/operator-controller-controller-manager --replicas=0
111+ kubectl -n $(OPERATOR_CONTROLLER_NAMESPACE ) run pvc-copy --image busybox --restart=Never --override-type strategic --overrides=' {"spec": {"volumes": [{"name": "data", "persistentVolumeClaim": {"claimName": "e2e-coverage"}}], "containers": [{"name": "pvc-copy", "volumeMounts": [{"name": "data", "mountPath": "/data"}]}]}}' -- sleep infinity
112+ kubectl -n $(OPERATOR_CONTROLLER_NAMESPACE ) wait --for=condition=ready pod pvc-copy
113+ kubectl -n $(OPERATOR_CONTROLLER_NAMESPACE ) cp pvc-copy:/data/ ./coverage/
114+ go tool covdata textfmt -i=./coverage/ -o e2e-cover.out
107115
108116kind-load : $(KIND ) # # Loads the currently constructed image onto the cluster
109117 $(KIND ) load docker-image $(IMG ) --name $(KIND_CLUSTER_NAME )
@@ -174,7 +182,7 @@ release: $(GORELEASER) ## Runs goreleaser for the operator-controller. By defaul
174182
175183quickstart : export MANIFEST="https://github.com/operator-framework/operator-controller/releases/download/$(VERSION ) /operator-controller.yaml"
176184quickstart : $(KUSTOMIZE ) generate # # Generate the installation release manifests and scripts
177- $(KUSTOMIZE ) build config/default | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
185+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | sed " s/:devel/:$( VERSION) /g" > operator-controller.yaml
178186 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh
179187
180188# #@ Deployment
@@ -186,7 +194,7 @@ endif
186194.PHONY : install
187195install : export MANIFEST="./operator-controller.yaml"
188196install : manifests $(KUSTOMIZE ) generate # # Install CRDs into the K8s cluster specified in ~/.kube/config.
189- $(KUSTOMIZE ) build config/default > operator-controller.yaml
197+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) > operator-controller.yaml
190198 envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s
191199
192200.PHONY : uninstall
@@ -196,8 +204,8 @@ uninstall: manifests $(KUSTOMIZE) ## Uninstall CRDs from the K8s cluster specifi
196204.PHONY : deploy
197205deploy : manifests $(KUSTOMIZE ) # # Deploy controller to the K8s cluster specified in ~/.kube/config.
198206 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
199- $(KUSTOMIZE ) build config/default | kubectl apply -f -
207+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl apply -f -
200208
201209.PHONY : undeploy
202210undeploy : # # 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 -
211+ $(KUSTOMIZE ) build $( KUSTOMIZE_BUILD_DIR ) | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
0 commit comments