@@ -85,37 +85,12 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64
85
85
# which is disabled with GOFLAGS=-mod=vendor).
86
86
configvar GOFLAGS_VENDOR " $( [ -d vendor ] && echo ' -mod=vendor' ) " " Go flags for using the vendor directory"
87
87
88
- # Go versions can be specified separately for different tasks
89
- # If the pre-installed Go is missing or a different
90
- # version, the required version here will get installed
91
- # from https://golang.org/dl/.
92
- go_from_travis_yml () {
93
- grep " ^ *- go:" " ${RELEASE_TOOLS_ROOT} /travis.yml" | sed -e ' s/.*go: *//'
94
- }
95
- configvar CSI_PROW_GO_VERSION_BUILD " $( go_from_travis_yml) " " Go version for building the component" # depends on component's source code
88
+ configvar CSI_PROW_GO_VERSION_BUILD " 1.16" " Go version for building the component" # depends on component's source code
96
89
configvar CSI_PROW_GO_VERSION_E2E " " " override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e
97
90
configvar CSI_PROW_GO_VERSION_SANITY " ${CSI_PROW_GO_VERSION_BUILD} " " Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below
98
91
configvar CSI_PROW_GO_VERSION_KIND " ${CSI_PROW_GO_VERSION_BUILD} " " Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below
99
92
configvar CSI_PROW_GO_VERSION_GINKGO " ${CSI_PROW_GO_VERSION_BUILD} " " Go version for building ginkgo" # depends on CSI_PROW_GINKGO_VERSION below
100
93
101
- # kind version to use. If the pre-installed version is different,
102
- # the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases
103
- # (if available), otherwise it is built from source.
104
- configvar CSI_PROW_KIND_VERSION " v0.9.0" " kind"
105
-
106
- # kind images to use. Must match the kind version.
107
- # The release notes of each kind release list the supported images.
108
- configvar CSI_PROW_KIND_IMAGES " kindest/node:v1.19.1@sha256:98cf5288864662e37115e362b23e4369c8c4a408f99cbc06e58ac30ddc721600
109
- kindest/node:v1.18.8@sha256:f4bcc97a0ad6e7abaf3f643d890add7efe6ee4ab90baeb374b4f41a4c95567eb
110
- kindest/node:v1.17.11@sha256:5240a7a2c34bf241afb54ac05669f8a46661912eab05705d660971eeb12f6555
111
- kindest/node:v1.16.15@sha256:a89c771f7de234e6547d43695c7ab047809ffc71a0c3b65aa54eda051c45ed20
112
- kindest/node:v1.15.12@sha256:d9b939055c1e852fe3d86955ee24976cab46cba518abcb8b13ba70917e6547a6
113
- kindest/node:v1.14.10@sha256:ce4355398a704fca68006f8a29f37aafb49f8fc2f64ede3ccd0d9198da910146
114
- kindest/node:v1.13.12@sha256:1c1a48c2bfcbae4d5f4fa4310b5ed10756facad0b7a2ca93c7a4b5bae5db29f5" " kind images"
115
-
116
- # Use kind node-image --type=bazel by default, but allow to disable that.
117
- configvar CSI_PROW_USE_BAZEL true " use Bazel during 'kind node-image' invocation"
118
-
119
94
# ginkgo test runner version to use. If the pre-installed version is
120
95
# different, the desired version is built from source.
121
96
configvar CSI_PROW_GINKGO_VERSION v1.7.0 " Ginkgo"
@@ -152,10 +127,37 @@ configvar CSI_PROW_KUBERNETES_VERSION 1.17.0 "Kubernetes"
152
127
# when a Prow job just defines the Kubernetes version.
153
128
csi_prow_kubernetes_version_suffix=" $( echo " ${CSI_PROW_KUBERNETES_VERSION} " | tr . _ | tr ' [:lower:]' ' [:upper:]' | sed -e ' s/^RELEASE-//' -e ' s/\([0-9]*\)_\([0-9]*\).*/\1_\2/' ) "
154
129
155
- # Work directory. It has to allow running executables, therefore /tmp
156
- # is avoided. Cleaning up after the script is intentionally left to
157
- # the caller.
158
- configvar CSI_PROW_WORK " $( mkdir -p " $GOPATH /pkg" && mktemp -d " $GOPATH /pkg/csiprow.XXXXXXXXXX" ) " " work directory"
130
+ # Only the latest KinD is (eventually) guaranteed to work with the
131
+ # latest Kubernetes. For example, KinD 0.10.0 failed with Kubernetes
132
+ # 1.21.0-beta1. Therefore the default version of KinD is "main"
133
+ # for that, otherwise the latest stable release for which we then
134
+ # list the officially supported images below.
135
+ kind_version_default () {
136
+ case " ${CSI_PROW_KUBERNETES_VERSION} " in
137
+ latest|master)
138
+ echo main;;
139
+ * )
140
+ echo v0.10.0;;
141
+ esac
142
+ }
143
+
144
+ # kind version to use. If the pre-installed version is different,
145
+ # the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases
146
+ # (if available), otherwise it is built from source.
147
+ configvar CSI_PROW_KIND_VERSION " $( kind_version_default) " " kind"
148
+
149
+ # kind images to use. Must match the kind version.
150
+ # The release notes of each kind release list the supported images.
151
+ configvar CSI_PROW_KIND_IMAGES " kindest/node:v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab
152
+ kindest/node:v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca
153
+ kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
154
+ kindest/node:v1.17.17@sha256:7b6369d27eee99c7a85c48ffd60e11412dc3f373658bc59b7f4d530b7056823e
155
+ kindest/node:v1.16.15@sha256:c10a63a5bda231c0a379bf91aebf8ad3c79146daca59db816fb963f731852a99
156
+ kindest/node:v1.15.12@sha256:67181f94f0b3072fb56509107b380e38c55e23bf60e6f052fbd8052d26052fb5
157
+ kindest/node:v1.14.10@sha256:3fbed72bcac108055e46e7b4091eb6858ad628ec51bf693c21f5ec34578f6180" " kind images"
158
+
159
+ # Use kind node-image --type=bazel by default, but allow to disable that.
160
+ configvar CSI_PROW_USE_BAZEL true " use Bazel during 'kind node-image' invocation"
159
161
160
162
# By default, this script tests sidecars with the CSI hostpath driver,
161
163
# using the install_csi_driver function. That function depends on
@@ -354,10 +356,23 @@ configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external
354
356
# to all the K8s versions we test against
355
357
configvar CSI_PROW_E2E_SKIP ' Disruptive|different\s+node' " tests that need to be skipped"
356
358
357
- # This is the directory for additional result files. Usually set by Prow, but
358
- # if not (for example, when invoking manually) it defaults to the work directory.
359
- configvar ARTIFACTS " ${CSI_PROW_WORK} /artifacts" " artifacts"
360
- mkdir -p " ${ARTIFACTS} "
359
+ # This creates directories that are required for testing.
360
+ ensure_paths () {
361
+ # Work directory. It has to allow running executables, therefore /tmp
362
+ # is avoided. Cleaning up after the script is intentionally left to
363
+ # the caller.
364
+ configvar CSI_PROW_WORK " $( mkdir -p " $GOPATH /pkg" && mktemp -d " $GOPATH /pkg/csiprow.XXXXXXXXXX" ) " " work directory"
365
+
366
+ # This is the directory for additional result files. Usually set by Prow, but
367
+ # if not (for example, when invoking manually) it defaults to the work directory.
368
+ configvar ARTIFACTS " ${CSI_PROW_WORK} /artifacts" " artifacts"
369
+ mkdir -p " ${ARTIFACTS} "
370
+
371
+ # For additional tools.
372
+ CSI_PROW_BIN=" ${CSI_PROW_WORK} /bin"
373
+ mkdir -p " ${CSI_PROW_BIN} "
374
+ PATH=" ${CSI_PROW_BIN} :$PATH "
375
+ }
361
376
362
377
run () {
363
378
echo " $( date) $( go version | sed -e ' s/.*version \(go[^ ]*\).*/\1/' ) $( if [ " $( pwd) " != " ${REPO_DIR} " ]; then pwd ; fi) \$ " " $@ " >&2
@@ -377,11 +392,6 @@ die () {
377
392
exit 1
378
393
}
379
394
380
- # For additional tools.
381
- CSI_PROW_BIN=" ${CSI_PROW_WORK} /bin"
382
- mkdir -p " ${CSI_PROW_BIN} "
383
- PATH=" ${CSI_PROW_BIN} :$PATH "
384
-
385
395
# Ensure that PATH has the desired version of the Go tools, then run command given as argument.
386
396
# Empty parameter uses the already installed Go. In Prow, that version is kept up-to-date by
387
397
# bumping the container image regularly.
@@ -410,7 +420,7 @@ install_kind () {
410
420
chmod u+x " ${CSI_PROW_WORK} /bin/kind"
411
421
else
412
422
git_checkout https://github.com/kubernetes-sigs/kind " ${GOPATH} /src/sigs.k8s.io/kind" " ${CSI_PROW_KIND_VERSION} " --depth=1 &&
413
- (cd " ${GOPATH} /src/sigs.k8s.io/kind" && make install INSTALL_DIR=" ${CSI_PROW_WORK} /bin" )
423
+ (cd " ${GOPATH} /src/sigs.k8s.io/kind" && run_with_go " $CSI_PROW_GO_VERSION_KIND " make install INSTALL_DIR=" ${CSI_PROW_WORK} /bin" )
414
424
fi
415
425
}
416
426
@@ -576,7 +586,8 @@ start_cluster () {
576
586
577
587
go_version=" $( go_version_for_kubernetes " ${CSI_PROW_WORK} /src/kubernetes" " $version " ) " || die " cannot proceed without knowing Go version for Kubernetes"
578
588
# Changing into the Kubernetes source code directory is a workaround for https://github.com/kubernetes-sigs/kind/issues/1910
579
- (cd " ${CSI_PROW_WORK} /src/kubernetes" && run_with_go " $go_version " kind build node-image --image csiprow/node:latest --type=" $type " --kube-root " ${CSI_PROW_WORK} /src/kubernetes" ) || die " 'kind build node-image' failed"
589
+ # shellcheck disable=SC2046
590
+ (cd " ${CSI_PROW_WORK} /src/kubernetes" && run_with_go " $go_version " kind build node-image --image csiprow/node:latest $( if [ " $CSI_PROW_KIND_VERSION " != " main" ]; then echo --type=" $type " ; fi) --kube-root " ${CSI_PROW_WORK} /src/kubernetes" ) || die " 'kind build node-image' failed"
580
591
csi_prow_kind_have_kubernetes=true
581
592
fi
582
593
image=" csiprow/node:latest"
@@ -1090,6 +1101,9 @@ main () {
1090
1101
local images ret
1091
1102
ret=0
1092
1103
1104
+ # Set up work directory.
1105
+ ensure_paths
1106
+
1093
1107
images=
1094
1108
if ${CSI_PROW_BUILD_JOB} ; then
1095
1109
# A successful build is required for testing.
@@ -1251,6 +1265,9 @@ gcr_cloud_build () {
1251
1265
# Required for "docker buildx build --push".
1252
1266
gcloud auth configure-docker
1253
1267
1268
+ # Might not be needed here, but call it just in case.
1269
+ ensure_paths
1270
+
1254
1271
if find . -name Dockerfile | grep -v ^./vendor | xargs --no-run-if-empty cat | grep -q ^RUN; then
1255
1272
# Needed for "RUN" steps on non-linux/amd64 platforms.
1256
1273
# See https://github.com/multiarch/qemu-user-static#getting-started
0 commit comments