File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -654,22 +654,30 @@ delete_cluster_inside_prow_job() {
654654# Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION
655655# in the given directory.
656656find_deployment () {
657- local dir file
657+ local dir file k8sver
658658 dir=" $1 "
659659
660- # Fixed deployment name? Use it if it exists, otherwise fail.
660+ # major/minor without release- prefix.
661+ k8sver=" $( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' -e ' s/^release-//' ) "
662+
663+ # Fixed deployment name? Use it if it exists.
661664 if [ " ${CSI_PROW_DEPLOYMENT} " ]; then
662665 file=" $dir /${CSI_PROW_DEPLOYMENT} /deploy.sh"
663- if ! [ -e " $file " ]; then
666+ if [ -e " $file " ]; then
667+ echo " $file "
668+ return 0
669+ fi
670+
671+ # CSI_PROW_DEPLOYMENT=kubernetes-x.yy is handled below with a fallback
672+ # to kubernetes-latest. If it is something else, then fail here.
673+ if ! echo " ${CSI_PROW_DEPLOYMENT} " | grep -q " ^kubernetes-${k8sver} \$ " ; then
664674 return 1
665675 fi
666- echo " $file "
667- return 0
668676 fi
669677
670678 # Ignore: See if you can use ${variable//search/replace} instead.
671679 # shellcheck disable=SC2001
672- file=" $dir /kubernetes-$( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/ ' ) ${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
680+ file=" $dir /kubernetes-${k8sver} ${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
673681 if ! [ -e " $file " ]; then
674682 file=" $dir /kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
675683 if ! [ -e " $file " ]; then
You can’t perform that action at this time.
0 commit comments