@@ -24,6 +24,8 @@ KIND_CLUSTER_NAME ?= operator-controller
24
24
25
25
CONTAINER_RUNTIME ?= docker
26
26
27
+ KUSTOMIZE_BUILD_DIR ?= config/default
28
+
27
29
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
28
30
ifeq (,$(shell go env GOBIN) )
29
31
GOBIN =$(shell go env GOPATH) /bin
@@ -103,7 +105,13 @@ test-unit: $(SETUP_ENVTEST) ## Run the unit tests
103
105
eval $$($(SETUP_ENVTEST ) use -p env $(ENVTEST_VERSION ) ) && go test -tags $(GO_BUILD_TAGS ) -count=1 -short $(UNIT_TEST_DIRS ) -coverprofile cover.out
104
106
105
107
e2e : KIND_CLUSTER_NAME=operator-controller-e2e
108
+ e2e : KUSTOMIZE_BUILD_DIR=config/e2e
106
109
e2e : 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
107
115
108
116
kind-load : $(KIND ) # # Loads the currently constructed image onto the cluster
109
117
$(KIND ) load docker-image $(IMG ) --name $(KIND_CLUSTER_NAME )
@@ -174,7 +182,7 @@ release: $(GORELEASER) ## Runs goreleaser for the operator-controller. By defaul
174
182
175
183
quickstart : export MANIFEST="https://github.com/operator-framework/operator-controller/releases/download/$(VERSION ) /operator-controller.yaml"
176
184
quickstart : $(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
178
186
envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh > install.sh
179
187
180
188
# #@ Deployment
@@ -186,7 +194,7 @@ endif
186
194
.PHONY : install
187
195
install : export MANIFEST="./operator-controller.yaml"
188
196
install : 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
190
198
envsubst ' $$CATALOGD_VERSION,$$CERT_MGR_VERSION,$$RUKPAK_VERSION,$$MANIFEST' < scripts/install.tpl.sh | bash -s
191
199
192
200
.PHONY : uninstall
@@ -196,8 +204,8 @@ uninstall: manifests $(KUSTOMIZE) ## Uninstall CRDs from the K8s cluster specifi
196
204
.PHONY : deploy
197
205
deploy : manifests $(KUSTOMIZE ) # # Deploy controller to the K8s cluster specified in ~/.kube/config.
198
206
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 -
200
208
201
209
.PHONY : undeploy
202
210
undeploy : # # 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