Skip to content

Commit

Permalink
Add watcher target to deploy operator via olm
Browse files Browse the repository at this point in the history
Since watcher-operator is going to standalone operator to be released
via FR2. In order to install it via olm, This pr adds make target in
the watcher-operator repo to achieve the same.

Jira: https://issues.redhat.com/browse/OSPRH-11419

Signed-off-by: Chandan Kumar <[email protected]>
  • Loading branch information
raukadah committed Nov 15, 2024
1 parent 9ca2cca commit 93cc854
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,13 @@ update-watcher-csv:
if [ "$(has_webhooks)" != "null" ]; then \
oc patch -n $(OPERATOR_NAMESPACE) $(csv) --type json -p='[{"op": "remove", "path": "/spec/webhookdefinitions"}]'; \
fi

.PHONY: watcher
watcher: ## Deploying watcher operator via olm
oc apply -f ci/olm.yaml
$(eval csvname=$(shell oc get csv -n openstack-operators -o jsonpath='{range .items[*]}{@.metadata.name}{"\n"}{end}' | grep -E "^watcher-operator\.v"))
timeout 30 bash -c 'until [ "$(shell oc get -n openstack-operators csv/$(csvname) -o jsonpath='{.status.phase}')" == "Succeeded" ]; do sleep 5; done'

.PHONY: watcher_cleanup
watcher_cleanup: ## Cleaning watcher operator via olm
oc delete -f ci/olm.yaml
34 changes: 34 additions & 0 deletions ci/olm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: openstack-operators
labels:
pod-security.kubernetes.io/enforce: privileged
security.openshift.io/scc.podSecurityLabelSync: "false"
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: watcher-operator-index
namespace: openstack-operators
spec:
image: quay.io/openstack-k8s-operators/watcher-operator-index:latest
sourceType: grpc
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openstack
namespace: openstack-operators
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: watcher-operator
namespace: openstack-operators
spec:
name: watcher-operator
channel: alpha
source: watcher-operator-index
sourceNamespace: openstack-operators

0 comments on commit 93cc854

Please sign in to comment.