Skip to content

Commit 14ce56b

Browse files
author
Mateus Oliveira
authored
feat: Add uninstall command (#1118)
Signed-off-by: Mateus Oliveira <[email protected]>
1 parent fd6a7cf commit 14ce56b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,7 @@ GIT_REV:=$(shell git rev-parse --short HEAD)
372372
deploy-olm: THIS_OPERATOR_IMAGE?=ttl.sh/oadp-operator-$(GIT_REV):1h # Set target specific variable
373373
deploy-olm: THIS_BUNDLE_IMAGE?=ttl.sh/oadp-operator-bundle-$(GIT_REV):1h # Set target specific variable
374374
deploy-olm: DEPLOY_TMP:=$(shell mktemp -d)/ # Set target specific variable
375-
deploy-olm: operator-sdk ## Build current branch operator image, bundle image, push and install via OLM
376-
oc whoami # Check if logged in
377-
oc create namespace $(OADP_TEST_NAMESPACE) || true
378-
$(OPERATOR_SDK) cleanup oadp-operator --namespace $(OADP_TEST_NAMESPACE)
375+
deploy-olm: operator-sdk undeploy-olm ## Build current branch operator image, bundle image, push and install via OLM
379376
@echo "DEPLOY_TMP: $(DEPLOY_TMP)"
380377
# build and push operator and bundle image
381378
# use $(OPERATOR_SDK) to install bundle to authenticated cluster
@@ -385,6 +382,12 @@ deploy-olm: operator-sdk ## Build current branch operator image, bundle image, p
385382
rm -rf $(DEPLOY_TMP)
386383
$(OPERATOR_SDK) run bundle $(THIS_BUNDLE_IMAGE) --namespace $(OADP_TEST_NAMESPACE)
387384

385+
.PHONY: undeploy-olm
386+
undeploy-olm: ## Uninstall current branch operator via OLM
387+
oc whoami # Check if logged in
388+
oc create namespace $(OADP_TEST_NAMESPACE) || true
389+
$(OPERATOR_SDK) cleanup oadp-operator --namespace $(OADP_TEST_NAMESPACE)
390+
388391
.PHONY: opm
389392
OPM = ./bin/opm
390393
opm: ## Download opm locally if necessary.

docs/developer/install_from_source.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ To install CRDs and deploy the OADP operator to the `openshift-adp`
2424
$ make deploy-olm
2525
```
2626

27+
After testing, uninstall CRDs and undeploy the OADP operator from `openshift-adp` namespace, running
28+
```
29+
$ make undeploy-olm
30+
```
31+
2732
### Installing Velero + Restic
2833

2934
#### Creating credentials secret

docs/developer/olm_hacking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h1 align="center">OLM Integration</h1>
33

44
# Creating your own CatalogSource
5-
If you just want to use latest code without making your own catalogsource, you can use `make deploy-olm` as described in [install_olm.md](install_olm.md)
5+
If you just want to use latest code without making your own catalogsource, you can follow steps from [Installing the Operator](install_from_source.md#installing-the-operator).
66

77
Create `oadp-operator-source.yaml` file like below in the oadp-operator directory:
88

docs/developer/testing/AttatchingIDEDebuggers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ You can now use Run and Debug menu to launch
5656
- Debug E2E Test
5757
- This runs the test suite in debug mode. You can add breakpoints to step through the end to end test.
5858
- Prerequisites:
59-
- You have installed OADP Operator. To install current commit run `make deploy-olm`
59+
- You have installed OADP Operator. To install current commit follow steps from [Installing the Operator](../install_from_source.md#installing-the-operator).
6060
- Launch main.go
6161
- This runs the operator on your machine in debug mode. You can add breakpoints and step through the code.
6262
- You will not see OADP in Installed Operators but it will be watching for DPA resources in the namespace as if it was installed.

0 commit comments

Comments
 (0)