Skip to content

Commit 86ab977

Browse files
Add targets to Makefile
This commit adds two additional Makefile targets to Makefile: cleanup: Since operator-controller is the single point of entry and `make run` installs Rukpak and Cert-manager, it would be good to have a target that cleans up the cluster of controller and all its dependencies. run-local: To be able to run the controller locally, it is useful for developments so that we need not always have to build image to test operator.
1 parent 520219c commit 86ab977

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ build: manifests generate fmt vet ## Build manager binary.
100100
.PHONY: run
101101
run: docker-build kind-cluster kind-load cert-mgr rukpak install deploy wait ## Build the operator-controller then deploy it into a new kind cluster.
102102

103+
.PHONY: run-local
104+
run-local: manifests generate fmt vet ## Run a controller from your host. Make sure that necessary CRDs are installed in the cluster.
105+
go run ./main.go
106+
103107
.PHONY: wait
104108
wait:
105109
kubectl wait --for=condition=Available --namespace=$(OPERATOR_CONTROLLER_NAMESPACE) deployment/operator-controller-controller-manager --timeout=$(WAIT_TIMEOUT)
@@ -166,6 +170,12 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
166170
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.
167171
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
168172

173+
# cleans up all the operator resources and their dependents like cert-manager and rukpak
174+
.PHONY: cleanup
175+
cleanup: undeploy uninstall
176+
kubectl delete --ignore-not-found=$(ignore-not-found) -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MGR_VERSION)/cert-manager.yaml
177+
kubectl delete --ignore-not-found=$(ignore-not-found) -f https://github.com/operator-framework/rukpak/releases/latest/download/rukpak.yaml
178+
169179
##@ Build Dependencies
170180

171181
## Location to install dependencies to

0 commit comments

Comments
 (0)