Skip to content

Commit 12d9b6e

Browse files
committed
prow.sh: add CSI_PROW_DEPLOYMENT_SUFFIX
This can be used in Prow jobs which want to let prow.sh find the deployment directory based on the Kubernetes version but don't want the default "kubernetes-x.yy" deployments. The alternative would be to let Prow jobs set CSI_PROW_DEPLOYMENT, but then the fallback to kubernetes-latest wouldn't work.
1 parent 405cfda commit 12d9b6e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

release-tools/prow.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
190190
# CSI_PROW_DEPLOYMENT variable can be set in the
191191
# .prow.sh of each component when there are breaking changes
192192
# that require using a non-default deployment. The default
193-
# is a deployment named "kubernetes-x.yy" (if available),
194-
# otherwise "kubernetes-latest".
193+
# is a deployment named "kubernetes-x.yy${CSI_PROW_DEPLOYMENT_SUFFIX}" (if available),
194+
# otherwise "kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}".
195195
# "none" disables the deployment of the hostpath driver.
196196
#
197197
# When no deploy script is found (nothing in `deploy` directory,
@@ -203,6 +203,7 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
203203
configvar CSI_PROW_DRIVER_VERSION "v1.3.0" "CSI driver version"
204204
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo"
205205
configvar CSI_PROW_DEPLOYMENT "" "deployment"
206+
configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[-suffix].yaml files"
206207

207208
# The install_csi_driver function may work also for other CSI drivers,
208209
# as long as they follow the conventions of the CSI hostpath driver.
@@ -647,9 +648,9 @@ find_deployment () {
647648

648649
# Ignore: See if you can use ${variable//search/replace} instead.
649650
# shellcheck disable=SC2001
650-
file="$dir/kubernetes-$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/')/deploy.sh"
651+
file="$dir/kubernetes-$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/')${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh"
651652
if ! [ -e "$file" ]; then
652-
file="$dir/kubernetes-latest/deploy.sh"
653+
file="$dir/kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh"
653654
if ! [ -e "$file" ]; then
654655
return 1
655656
fi

0 commit comments

Comments
 (0)