Files
odo/scripts/setup-operators.sh
Dharmit Shah e66e8ca157 Adds support for linking a Devfile component with an Operator backed service (#3557)
* Add dependency on service binding operator

* Add extra dependencies for service binding operator

* Adds support for odo link between component and operator hub service

* Add owner reference for the link

* Deals with inability to install SBO the OLM way on k8s

https://github.com/redhat-developer/service-binding-operator/issues/536

* Adds and removes 'odo link' entry to/from env.yaml

* Makes odo push set appropriate "envFrom" for a podTemplateSpec

* Changes to unit test & those based on PR feedback

* Rebase and "glide update -v"

* Make the linter happy. Remove unused variables

* Fix unit test of envinfo to include 'link' paramter

* Move 'odo link' tests under operator hub tests

* Install SBO on the cluster

* Changes as per PR feedback

* Check for Operator before trying to create a link

* Change error message expected in tests

* Make example less confusing by using less 'example'
2020-07-23 13:49:09 +02:00

96 lines
2.0 KiB
Bash

#!/bin/bash
set -x
CI_OPERATOR_HUB_PROJECT=ci-operator-hub-project
install_mongo_operator() {
# First, enable a cluster-wide mongo operator
oc create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
generation: 1
name: mongodb-enterprise
namespace: openshift-operators
spec:
channel: stable
installPlanApproval: Automatic
name: mongodb-enterprise
source: certified-operators
sourceNamespace: openshift-marketplace
EOF
}
install_etcd_operator(){
# Create subscription
oc create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: etcd
namespace: openshift-operators
spec:
channel: clusterwide-alpha
installPlanApproval: Automatic
name: etcd
source: community-operators
sourceNamespace: openshift-marketplace
EOF
}
install_service_binding_operator(){
oc create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
generation: 1
name: service-binding-operator
namespace: openshift-operators
spec:
channel: alpha
installPlanApproval: Automatic
name: service-binding-operator
source: community-operators
sourceNamespace: openshift-marketplace
EOF
}
# install mongo operator
count=0
while [ "$count" -lt "5" ];
do
if oc get csv -n openshift-operators | grep mongo; then
break
else
install_mongo_operator
count=`expr $count + 1`
sleep 15
fi
done
# install etcd operator
count=0
while [ "$count" -lt "5" ];
do
if oc get csv -n openshift-operators | grep etcd; then
break
else
install_etcd_operator
count=`expr $count + 1`
sleep 15
fi
done
# install service-binding-operator
count=0
while [ "$count" -lt "5" ];
do
if oc get csv -n openshift-operators | grep service-binding-operator; then
break
else
install_service_binding_operator
count=`expr $count + 1`
sleep 15
fi
done