@@ -136,6 +136,9 @@ kind_version_default () {
136136 case " ${CSI_PROW_KUBERNETES_VERSION} " in
137137 latest|master)
138138 echo main;;
139+ 1.21* |release-1.21)
140+ # TODO: replace this special case once the next KinD release supports 1.21.
141+ echo main;;
139142 * )
140143 echo v0.10.0;;
141144 esac
@@ -159,11 +162,6 @@ kindest/node:v1.14.10@sha256:3fbed72bcac108055e46e7b4091eb6858ad628ec51bf693c21f
159162# Use kind node-image --type=bazel by default, but allow to disable that.
160163configvar CSI_PROW_USE_BAZEL true " use Bazel during 'kind node-image' invocation"
161164
162- # Work directory. It has to allow running executables, therefore /tmp
163- # is avoided. Cleaning up after the script is intentionally left to
164- # the caller.
165- configvar CSI_PROW_WORK " $( mkdir -p " $GOPATH /pkg" && mktemp -d " $GOPATH /pkg/csiprow.XXXXXXXXXX" ) " " work directory"
166-
167165# By default, this script tests sidecars with the CSI hostpath driver,
168166# using the install_csi_driver function. That function depends on
169167# a deployment script that it searches for in several places:
@@ -190,8 +188,8 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
190188# CSI_PROW_DEPLOYMENT variable can be set in the
191189# .prow.sh of each component when there are breaking changes
192190# that require using a non-default deployment. The default
193- # is a deployment named "kubernetes-x.yy" (if available),
194- # otherwise "kubernetes-latest".
191+ # is a deployment named "kubernetes-x.yy${CSI_PROW_DEPLOYMENT_SUFFIX} " (if available),
192+ # otherwise "kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX} ".
195193# "none" disables the deployment of the hostpath driver.
196194#
197195# When no deploy script is found (nothing in `deploy` directory,
@@ -203,6 +201,7 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
203201configvar CSI_PROW_DRIVER_VERSION " v1.3.0" " CSI driver version"
204202configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path " CSI driver repo"
205203configvar CSI_PROW_DEPLOYMENT " " " deployment"
204+ configvar CSI_PROW_DEPLOYMENT_SUFFIX " " " additional suffix in kubernetes-x.yy[suffix].yaml files"
206205
207206# The install_csi_driver function may work also for other CSI drivers,
208207# as long as they follow the conventions of the CSI hostpath driver.
@@ -361,10 +360,23 @@ configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external
361360# to all the K8s versions we test against
362361configvar CSI_PROW_E2E_SKIP ' Disruptive|different\s+node' " tests that need to be skipped"
363362
364- # This is the directory for additional result files. Usually set by Prow, but
365- # if not (for example, when invoking manually) it defaults to the work directory.
366- configvar ARTIFACTS " ${CSI_PROW_WORK} /artifacts" " artifacts"
367- mkdir -p " ${ARTIFACTS} "
363+ # This creates directories that are required for testing.
364+ ensure_paths () {
365+ # Work directory. It has to allow running executables, therefore /tmp
366+ # is avoided. Cleaning up after the script is intentionally left to
367+ # the caller.
368+ configvar CSI_PROW_WORK " $( mkdir -p " $GOPATH /pkg" && mktemp -d " $GOPATH /pkg/csiprow.XXXXXXXXXX" ) " " work directory"
369+
370+ # This is the directory for additional result files. Usually set by Prow, but
371+ # if not (for example, when invoking manually) it defaults to the work directory.
372+ configvar ARTIFACTS " ${CSI_PROW_WORK} /artifacts" " artifacts"
373+ mkdir -p " ${ARTIFACTS} "
374+
375+ # For additional tools.
376+ CSI_PROW_BIN=" ${CSI_PROW_WORK} /bin"
377+ mkdir -p " ${CSI_PROW_BIN} "
378+ PATH=" ${CSI_PROW_BIN} :$PATH "
379+ }
368380
369381run () {
370382 echo " $( date) $( go version | sed -e ' s/.*version \(go[^ ]*\).*/\1/' ) $( if [ " $( pwd) " != " ${REPO_DIR} " ]; then pwd ; fi) \$ " " $@ " >&2
@@ -384,11 +396,6 @@ die () {
384396 exit 1
385397}
386398
387- # For additional tools.
388- CSI_PROW_BIN=" ${CSI_PROW_WORK} /bin"
389- mkdir -p " ${CSI_PROW_BIN} "
390- PATH=" ${CSI_PROW_BIN} :$PATH "
391-
392399# Ensure that PATH has the desired version of the Go tools, then run command given as argument.
393400# Empty parameter uses the already installed Go. In Prow, that version is kept up-to-date by
394401# bumping the container image regularly.
@@ -647,9 +654,9 @@ find_deployment () {
647654
648655 # Ignore: See if you can use ${variable//search/replace} instead.
649656 # shellcheck disable=SC2001
650- file=" $dir /kubernetes-$( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' ) /deploy.sh"
657+ file=" $dir /kubernetes-$( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' ) ${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
651658 if ! [ -e " $file " ]; then
652- file=" $dir /kubernetes-latest/deploy.sh"
659+ file=" $dir /kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
653660 if ! [ -e " $file " ]; then
654661 return 1
655662 fi
@@ -1098,6 +1105,9 @@ main () {
10981105 local images ret
10991106 ret=0
11001107
1108+ # Set up work directory.
1109+ ensure_paths
1110+
11011111 images=
11021112 if ${CSI_PROW_BUILD_JOB} ; then
11031113 # A successful build is required for testing.
@@ -1259,6 +1269,9 @@ gcr_cloud_build () {
12591269 # Required for "docker buildx build --push".
12601270 gcloud auth configure-docker
12611271
1272+ # Might not be needed here, but call it just in case.
1273+ ensure_paths
1274+
12621275 if find . -name Dockerfile | grep -v ^./vendor | xargs --no-run-if-empty cat | grep -q ^RUN; then
12631276 # Needed for "RUN" steps on non-linux/amd64 platforms.
12641277 # See https://github.com/multiarch/qemu-user-static#getting-started
0 commit comments