Avoid creating the OperatorSource if already there
Avoid trying to create the OperatorSource if already there:
certified-operators, community-operators, redhat-operators
are there by default on OCP.
@@ -103,6 +103,7 @@ spec: {}
EOF
fi
+if [ `oc get OperatorSource "${APP_REGISTRY}" -n "${MARKETPLACE_NAMESPACE}" --no-headers 2> /dev/null | wc -l` -eq 0 ]; then
echo "Creating OperatorSource"
cat <<EOF | oc create -f -
apiVersion: operators.coreos.com/v1
@@ -118,6 +119,7 @@ spec:
publisher: "Kubevirt"
${AUTH_TOKEN}
EOF
+fi
echo "Give the cluster 30 seconds to create the catalogSourceConfig..."
sleep 30
