forked from rthallisey/operator-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupgrade.sh
More file actions
executable file
·17 lines (12 loc) · 729 Bytes
/
upgrade.sh
File metadata and controls
executable file
·17 lines (12 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -ex
CNV_VERSION="${CNV_VERSION:-2.1.0}"
TARGET_NAMESPACE="${TARGET_NAMESPACE:-openshift-cnv}"
upgrade_ip=$(oc get installplan -n ${TARGET_NAMESPACE} --no-headers | grep -v alpha | grep kubevirt-hyperconverged-operator.v${CNV_VERSION} | awk '{print $1}')
oc get installplan -o yaml -n ${TARGET_NAMESPACE} ${upgrade_ip} | sed 's/approved: false/approved: true/' | oc apply -n openshift-cnv -f -
echo "Waiting for the installplan to reach complete status"
echo "This could take up to 10 minutes..."
while [ -z "$(oc get installplan -n ${TARGET_NAMESPACE} ${upgrade_ip} -o=jsonpath={.status.phase} | grep Complete)" ]; do
echo "Waiting for ${upgrade_ip} InstallPlan to be in 'Complete'..."
sleep 10
done