|
3 | 3 | # Do we need this? |
4 | 4 | set -e |
5 | 5 | # We need settings |
| 6 | +unset KUBECONFIG |
6 | 7 | if test -n "$1"; then |
7 | 8 | SET="$1" |
8 | 9 | else |
|
12 | 13 | fi |
13 | 14 | # Read settings -- make sure you can trust it |
14 | 15 | source "$SET" |
| 16 | +# If we have an array, match what CS_VERSION we want to wait for |
| 17 | +if test "${CS_VERSION:0:1}" = "["; then |
| 18 | + VERSIONS="$(echo $CS_VERSION | sed -e 's/\[//' -e 's/\]//' -e 's/,/ /g')" |
| 19 | + for ver in $VERSIONS; do |
| 20 | + #echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${ver/./-} readiness" |
| 21 | + echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${ver/./-} creation" |
| 22 | + kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${ver/./-} --for create |
| 23 | + done |
| 24 | + VERSIONS=$(kubectl get clusterstackreleases -n $CS_NAMESPACE -o "custom-columns=NAME:.metadata.name,K8SVER:.status.kubernetesVersion") |
| 25 | + echo -e "# Table of registered clusterstackreleases:\n$VERSIONS" |
| 26 | + while read csnm k8sver; do |
| 27 | + if test "$csnm" = "NAME"; then continue; fi |
| 28 | + if test "$k8sver" = "v$CL_PATCHVER"; then |
| 29 | + CS_VERSION="v${csnm#openstack-scs-?-??-v}" |
| 30 | + CS_VERSION="${CS_VERSION%-*}.${CS_VERSION##*-}" |
| 31 | + break |
| 32 | + fi |
| 33 | + done < <(echo "$VERSIONS") |
| 34 | + if test "${CS_VERSION:0:1}" = "["; then |
| 35 | + echo "No clusterstackrelease with v$CL_PATCHVER found" |
| 36 | + fi |
| 37 | +else |
| 38 | + echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} readiness" |
| 39 | + kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} --for condition=ready |
| 40 | +fi |
| 41 | +echo "# Wait for clusterclass -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${CS_VERSION} creation" |
15 | 42 | kubectl wait -n "$CS_NAMESPACE" clusterclass openstack-scs-${CS_MAINVER/./-}-${CS_VERSION} --for create |
16 | 43 | kubectl get clusterclasses -n "$CS_NAMESPACE" |
17 | 44 | kubectl get images -n "$CS_NAMESPACE" |
18 | | -kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} --for condition=ready |
|
0 commit comments