File tree 1 file changed +14
-6
lines changed
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() {
654
654
# Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION
655
655
# in the given directory.
656
656
find_deployment () {
657
- local dir file
657
+ local dir file k8sver
658
658
dir=" $1 "
659
659
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.
661
664
if [ " ${CSI_PROW_DEPLOYMENT} " ]; then
662
665
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
664
674
return 1
665
675
fi
666
- echo " $file "
667
- return 0
668
676
fi
669
677
670
678
# Ignore: See if you can use ${variable//search/replace} instead.
671
679
# 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"
673
681
if ! [ -e " $file " ]; then
674
682
file=" $dir /kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
675
683
if ! [ -e " $file " ]; then
You can’t perform that action at this time.
0 commit comments