From c63c61b3b23ed429103533f4bf76ad85e01e1d35 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 3 May 2021 21:26:19 +0200 Subject: [PATCH 1/2] 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. --- prow.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/prow.sh b/prow.sh index aa471c0b..74fe5338 100755 --- a/prow.sh +++ b/prow.sh @@ -185,8 +185,8 @@ configvar CSI_PROW_USE_BAZEL true "use Bazel during 'kind node-image' invocation # CSI_PROW_DEPLOYMENT variable can be set in the # .prow.sh of each component when there are breaking changes # that require using a non-default deployment. The default -# is a deployment named "kubernetes-x.yy" (if available), -# otherwise "kubernetes-latest". +# is a deployment named "kubernetes-x.yy${CSI_PROW_DEPLOYMENT_SUFFIX}" (if available), +# otherwise "kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}". # "none" disables the deployment of the hostpath driver. # # 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 configvar CSI_PROW_DRIVER_VERSION "v1.3.0" "CSI driver version" configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo" configvar CSI_PROW_DEPLOYMENT "" "deployment" +configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files" # The install_csi_driver function may work also for other CSI drivers, # as long as they follow the conventions of the CSI hostpath driver. @@ -650,9 +651,9 @@ find_deployment () { # Ignore: See if you can use ${variable//search/replace} instead. # shellcheck disable=SC2001 - file="$dir/kubernetes-$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/')/deploy.sh" + file="$dir/kubernetes-$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/')${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh" if ! [ -e "$file" ]; then - file="$dir/kubernetes-latest/deploy.sh" + file="$dir/kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh" if ! [ -e "$file" ]; then return 1 fi From 510fb0f9c957bb8b131ea3cf5e524ecde51ce0dc Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 4 May 2021 14:17:42 +0200 Subject: [PATCH 2/2] prow.sh: support Kubernetes 1.21 Jobs that specifically use Kubernetes 1.21 have to use the unrelease KinD because the latest stable release, 0.10.0, is not compatible with it. This special case can be removed once the next KinD release is out. --- prow.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prow.sh b/prow.sh index 74fe5338..fe23cf51 100755 --- a/prow.sh +++ b/prow.sh @@ -136,6 +136,9 @@ kind_version_default () { case "${CSI_PROW_KUBERNETES_VERSION}" in latest|master) echo main;; + 1.21*|release-1.21) + # TODO: replace this special case once the next KinD release supports 1.21. + echo main;; *) echo v0.10.0;; esac