@@ -136,6 +136,9 @@ kind_version_default () {
136
136
case " ${CSI_PROW_KUBERNETES_VERSION} " in
137
137
latest|master)
138
138
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;;
139
142
* )
140
143
echo v0.10.0;;
141
144
esac
@@ -159,11 +162,6 @@ kindest/node:v1.14.10@sha256:3fbed72bcac108055e46e7b4091eb6858ad628ec51bf693c21f
159
162
# Use kind node-image --type=bazel by default, but allow to disable that.
160
163
configvar CSI_PROW_USE_BAZEL true " use Bazel during 'kind node-image' invocation"
161
164
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
-
167
165
# By default, this script tests sidecars with the CSI hostpath driver,
168
166
# using the install_csi_driver function. That function depends on
169
167
# 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
190
188
# CSI_PROW_DEPLOYMENT variable can be set in the
191
189
# .prow.sh of each component when there are breaking changes
192
190
# 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} ".
195
193
# "none" disables the deployment of the hostpath driver.
196
194
#
197
195
# 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
203
201
configvar CSI_PROW_DRIVER_VERSION " v1.3.0" " CSI driver version"
204
202
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path " CSI driver repo"
205
203
configvar CSI_PROW_DEPLOYMENT " " " deployment"
204
+ configvar CSI_PROW_DEPLOYMENT_SUFFIX " " " additional suffix in kubernetes-x.yy[suffix].yaml files"
206
205
207
206
# The install_csi_driver function may work also for other CSI drivers,
208
207
# 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
361
360
# to all the K8s versions we test against
362
361
configvar CSI_PROW_E2E_SKIP ' Disruptive|different\s+node' " tests that need to be skipped"
363
362
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
+ }
368
380
369
381
run () {
370
382
echo " $( date) $( go version | sed -e ' s/.*version \(go[^ ]*\).*/\1/' ) $( if [ " $( pwd) " != " ${REPO_DIR} " ]; then pwd ; fi) \$ " " $@ " >&2
@@ -384,11 +396,6 @@ die () {
384
396
exit 1
385
397
}
386
398
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
-
392
399
# Ensure that PATH has the desired version of the Go tools, then run command given as argument.
393
400
# Empty parameter uses the already installed Go. In Prow, that version is kept up-to-date by
394
401
# bumping the container image regularly.
@@ -647,9 +654,9 @@ find_deployment () {
647
654
648
655
# Ignore: See if you can use ${variable//search/replace} instead.
649
656
# 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"
651
658
if ! [ -e " $file " ]; then
652
- file=" $dir /kubernetes-latest/deploy.sh"
659
+ file=" $dir /kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX} /deploy.sh"
653
660
if ! [ -e " $file " ]; then
654
661
return 1
655
662
fi
@@ -1098,6 +1105,9 @@ main () {
1098
1105
local images ret
1099
1106
ret=0
1100
1107
1108
+ # Set up work directory.
1109
+ ensure_paths
1110
+
1101
1111
images=
1102
1112
if ${CSI_PROW_BUILD_JOB} ; then
1103
1113
# A successful build is required for testing.
@@ -1259,6 +1269,9 @@ gcr_cloud_build () {
1259
1269
# Required for "docker buildx build --push".
1260
1270
gcloud auth configure-docker
1261
1271
1272
+ # Might not be needed here, but call it just in case.
1273
+ ensure_paths
1274
+
1262
1275
if find . -name Dockerfile | grep -v ^./vendor | xargs --no-run-if-empty cat | grep -q ^RUN; then
1263
1276
# Needed for "RUN" steps on non-linux/amd64 platforms.
1264
1277
# See https://github.com/multiarch/qemu-user-static#getting-started
0 commit comments