Skip to content

Commit c63c61b

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 51ac11c commit c63c61b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: prow.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ configvar CSI_PROW_USE_BAZEL true "use Bazel during 'kind node-image' invocation
185185
# CSI_PROW_DEPLOYMENT variable can be set in the
186186
# .prow.sh of each component when there are breaking changes
187187
# that require using a non-default deployment. The default
188-
# is a deployment named "kubernetes-x.yy" (if available),
189-
# otherwise "kubernetes-latest".
188+
# is a deployment named "kubernetes-x.yy${CSI_PROW_DEPLOYMENT_SUFFIX}" (if available),
189+
# otherwise "kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}".
190190
# "none" disables the deployment of the hostpath driver.
191191
#
192192
# When no deploy script is found (nothing in `deploy` directory,
@@ -198,6 +198,7 @@ configvar CSI_PROW_USE_BAZEL true "use Bazel during 'kind node-image' invocation
198198
configvar CSI_PROW_DRIVER_VERSION "v1.3.0" "CSI driver version"
199199
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo"
200200
configvar CSI_PROW_DEPLOYMENT "" "deployment"
201+
configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files"
201202

202203
# The install_csi_driver function may work also for other CSI drivers,
203204
# as long as they follow the conventions of the CSI hostpath driver.
@@ -650,9 +651,9 @@ find_deployment () {
650651

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

0 commit comments

Comments
 (0)