Created
December 10, 2020 15:20
-
-
Save shvasude/e006970c8b22f0ca87bc526bc2c14eee to your computer and use it in GitHub Desktop.
subcsribes to the catalog source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
NAME='rh-service-binding-operator' | |
OPSRC_NAME='redhat-operators' | |
CHANNEL='beta' | |
CATALOG_SOURCE_NAME=$CATALOG_SOURCE_NAME | |
CURRENT_CSV="$(oc get packagemanifests -o json | jq --arg NAME1 "$NAME" --arg CATALOG_SOURCE_NAME1 "$CATALOG_SOURCE_NAME" --arg CHANNEL1 "$CHANNEL" -r '.items[] | select(.metadata.name==$NAME1) | select(.status.catalogSource==$CATALOG_SOURCE_NAME1).status.channels[] | select(.name==$CHANNEL1).currentCSV')" | |
kubectl apply -f - << EOD | |
apiVersion: operators.coreos.com/v1alpha1 | |
kind: Subscription | |
metadata: | |
name: "$NAME" | |
namespace: openshift-operators | |
spec: | |
channel: beta | |
installPlanApproval: Automatic | |
name: "$NAME" | |
source: "$CATALOG_SOURCE_NAME" | |
sourceNamespace: openshift-marketplace | |
startingCSV: "$CURRENT_CSV" | |
EOD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment