diff --git a/Makefile b/Makefile index b59d8bd..e469fd5 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ci/olm.yaml b/ci/olm.yaml new file mode 100644 index 0000000..323a480 --- /dev/null +++ b/ci/olm.yaml @@ -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