Skip to content

Commit

Permalink
Update olm-testing tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
pmorie committed Mar 4, 2019
1 parent 83cc75e commit e07a070
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ use this to inject your quay account name.
#### Install federation using OLM

Run the `scripts/install-using-catalog-source.sh` script to install federation
into the `federation-test` namespace using OLM. This script also takes your
quay account name as an argument:
into the `federation-test` namespace using OLM. This script takes your quay
account name as an argument, and optionally the type of deployment to subscribe
to:

```
$ scripts/install-using-catalog-source.sh pmorie
$ scripts/install-using-catalog-source.sh pmorie <namespaced|cluster-scoped>
catalogsource.operators.coreos.com/federation unchanged
operatorgroup.operators.coreos.com/federation unchanged
subscription.operators.coreos.com/federation unchanged
Expand Down
9 changes: 7 additions & 2 deletions scripts/install-using-catalog-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
dir=$(realpath "$(dirname "${BASH_SOURCE}")/..")
subscription_type=${2:-"namespaced"}

declare -a subscription_types=("namespaced" "cluster-scoped")
if ! [[ $subscription_types =~ (^|[[:space:]])"$subscription_type"($|[[:space:]]) ]] ; then
echo "${subscription_type} is an invalid type to subscribe to; use ${subscription_types}"
exit 1
fi

registry=${REGISTRY:-$1}
if [[ -z "${registry}" ]]; then
echo "registry must be set by running \`install-using-catalog-source.sh <registry>\` or by setting \$REGISTRY"
exit 1
fi

sed -e "s,quay.io/openshift/federation-operator-registry,quay.io/$registry/federation-operator-registry," $dir/olm-testing/catalog-source.yaml | oc apply -f -
oc apply -f $dir/olm-testing/operator-group.yaml
oc apply -f $dir/olm-testing/cluster-scoped-operator-group.yaml
oc apply -f $dir/olm-testing/${subscription_type}-operator-group.yaml
oc apply -f $dir/olm-testing/${subscription_type}-subscription.yaml

0 comments on commit e07a070

Please sign in to comment.