@@ -52,6 +52,26 @@ configvar () {
52
52
eval echo " \$ 3:" " $1 =\$ {$1 }"
53
53
}
54
54
55
+ # Takes the minor version of $CSI_PROW_KUBERNETES_VERSION and overrides it to
56
+ # $1 if they are equal minor versions. Ignores versions that begin with
57
+ # "release-".
58
+ override_k8s_version () {
59
+ local current_minor_version
60
+ local override_minor_version
61
+
62
+ # Ignore: See if you can use ${variable//search/replace} instead.
63
+ # shellcheck disable=SC2001
64
+ current_minor_version=" $( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1\.\2/' ) "
65
+
66
+ # Ignore: See if you can use ${variable//search/replace} instead.
67
+ # shellcheck disable=SC2001
68
+ override_minor_version=" $( echo " ${1} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1\.\2/' ) "
69
+ if [ " ${current_minor_version} " == " ${override_minor_version} " ]; then
70
+ CSI_PROW_KUBERNETES_VERSION=" $1 "
71
+ echo " Overriding CSI_PROW_KUBERNETES_VERSION with $1 : $CSI_PROW_KUBERNETES_VERSION "
72
+ fi
73
+ }
74
+
55
75
# Prints the value of a variable + version suffix, falling back to variable + "LATEST".
56
76
get_versioned_variable () {
57
77
local var=" $1 "
@@ -81,7 +101,7 @@ configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version
81
101
# kind version to use. If the pre-installed version is different,
82
102
# the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases/download/
83
103
# (if available), otherwise it is built from source.
84
- configvar CSI_PROW_KIND_VERSION 0.2.1 " kind"
104
+ configvar CSI_PROW_KIND_VERSION v0.4.0 " kind"
85
105
86
106
# ginkgo test runner version to use. If the pre-installed version is
87
107
# different, the desired version is built from source.
@@ -108,6 +128,18 @@ configvar CSI_PROW_BUILD_JOB true "building code in repo enabled"
108
128
# deprecating or changing the implementation of an alpha feature.
109
129
configvar CSI_PROW_KUBERNETES_VERSION 1.13.3 " Kubernetes"
110
130
131
+ # This is a hack to workaround the issue that each version
132
+ # of kind currently only supports specific patch versions of
133
+ # Kubernetes. We need to override CSI_PROW_KUBERNETES_VERSION
134
+ # passed in by our CI/pull jobs to the versions that
135
+ # kind v0.4.0 supports.
136
+ #
137
+ # If the version is prefixed with "release-", then nothing
138
+ # is overridden.
139
+ override_k8s_version " 1.13.7"
140
+ override_k8s_version " 1.14.3"
141
+ override_k8s_version " 1.15.0"
142
+
111
143
# CSI_PROW_KUBERNETES_VERSION reduced to first two version numbers and
112
144
# with underscore (1_13 instead of 1.13.3) and in uppercase (LATEST
113
145
# instead of latest).
@@ -151,10 +183,10 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
151
183
#
152
184
# When no deploy script is found (nothing in `deploy` directory,
153
185
# CSI_PROW_HOSTPATH_REPO=none), nothing gets deployed.
154
- configvar CSI_PROW_HOSTPATH_VERSION fc52d13ba07922c80555a24616a5b16480350c3f " hostpath driver" # pre-1.1.0
186
+ configvar CSI_PROW_HOSTPATH_VERSION " v1.2.0-rc2 " " hostpath driver"
155
187
configvar CSI_PROW_HOSTPATH_REPO https://github.com/kubernetes-csi/csi-driver-host-path " hostpath repo"
156
188
configvar CSI_PROW_DEPLOYMENT " " " deployment"
157
- configvar CSI_PROW_HOSTPATH_DRIVER_NAME " csi- hostpath" " the driver (aka provisioner) name of the chosen hostpath driver"
189
+ configvar CSI_PROW_HOSTPATH_DRIVER_NAME " hostpath.csi.k8s.io " " the hostpath driver name "
158
190
159
191
# If CSI_PROW_HOSTPATH_CANARY is set (typically to "canary", but also
160
192
# "1.0-canary"), then all image versions are replaced with that
@@ -170,6 +202,7 @@ configvar CSI_PROW_HOSTPATH_CANARY "" "hostpath image"
170
202
# CSI_PROW_E2E_REPO=none disables E2E testing.
171
203
configvar CSI_PROW_E2E_VERSION_1_13 v1.14.0 " E2E version for Kubernetes 1.13.x" # we can't use the one from 1.13.x because it didn't have --storage.testdriver
172
204
configvar CSI_PROW_E2E_VERSION_1_14 v1.14.0 " E2E version for Kubernetes 1.14.x"
205
+ configvar CSI_PROW_E2E_VERSION_1_15 v1.15.0 " E2E version for Kubernetes 1.15.x"
173
206
# TODO: add new CSI_PROW_E2E_VERSION entry for future Kubernetes releases
174
207
configvar CSI_PROW_E2E_VERSION_LATEST master " E2E version for Kubernetes master" # testing against Kubernetes master is already tracking a moving target, so we might as well use a moving E2E version
175
208
configvar CSI_PROW_E2E_REPO_LATEST https://github.com/kubernetes/kubernetes " E2E repo for Kubernetes >= 1.13.x" # currently the same for all versions
@@ -277,6 +310,7 @@ configvar CSI_PROW_E2E_ALPHA "$(get_versioned_variable CSI_PROW_E2E_ALPHA "${csi
277
310
# it anymore for older releases.
278
311
configvar CSI_PROW_E2E_ALPHA_GATES_1_13 ' VolumeSnapshotDataSource=true,BlockVolume=true,CSIBlockVolume=true' " alpha feature gates for Kubernetes 1.13"
279
312
configvar CSI_PROW_E2E_ALPHA_GATES_1_14 ' VolumeSnapshotDataSource=true,ExpandCSIVolumes=true' " alpha feature gates for Kubernetes 1.14"
313
+ configvar CSI_PROW_E2E_ALPHA_GATES_1_15 ' VolumeSnapshotDataSource=true,ExpandCSIVolumes=true' " alpha feature gates for Kubernetes 1.15"
280
314
# TODO: add new CSI_PROW_ALPHA_GATES_xxx entry for future Kubernetes releases and
281
315
# add new gates to CSI_PROW_E2E_ALPHA_GATES_LATEST.
282
316
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST ' VolumeSnapshotDataSource=true,ExpandCSIVolumes=true' " alpha feature gates for latest Kubernetes"
@@ -464,40 +498,51 @@ start_cluster () {
464
498
image=" kindest/node:v${CSI_PROW_KUBERNETES_VERSION} "
465
499
fi
466
500
cat > " ${CSI_PROW_WORK} /kind-config.yaml" << EOF
467
- kind: Config
468
- apiVersion: kind.sigs.k8s.io/v1alpha2
501
+ kind: Cluster
502
+ apiVersion: kind.sigs.k8s.io/v1alpha3
469
503
nodes:
470
504
- role: control-plane
471
- kubeadmConfigPatches:
472
- - |
473
- apiVersion: kubeadm.k8s.io/v1beta1
474
- kind: ClusterConfiguration
475
- metadata:
476
- name: config
477
- apiServer:
478
- extraArgs:
479
- "feature-gates": "$gates "
480
- controllerManager:
481
- extraArgs:
482
- "feature-gates": "$gates "
483
- scheduler:
484
- extraArgs:
485
- "feature-gates": "$gates "
486
- - |
487
- apiVersion: kubelet.config.k8s.io/v1beta1
488
- kind: KubeletConfiguration
489
- metadata:
490
- name: config
491
- featureGates:
492
- $( list_gates " $gates " )
493
- - |
494
- apiVersion: kubeproxy.config.k8s.io/v1alpha1
495
- kind: KubeProxyConfiguration
496
- metadata:
497
- name: config
498
- featureGates:
505
+ EOF
506
+
507
+ # kubeadm has API dependencies between apiVersion and Kubernetes version
508
+ # 1.15+ requires kubeadm.k8s.io/v1beta2
509
+ # We only run alpha tests against master so we don't need to maintain
510
+ # different patches for different Kubernetes releases.
511
+ if [[ -n " $gates " ]]; then
512
+ cat >> " ${CSI_PROW_WORK} /kind-config.yaml" << EOF
513
+ kubeadmConfigPatches:
514
+ - |
515
+ apiVersion: kubeadm.k8s.io/v1beta2
516
+ kind: ClusterConfiguration
517
+ metadata:
518
+ name: config
519
+ apiServer:
520
+ extraArgs:
521
+ "feature-gates": "$gates "
522
+ controllerManager:
523
+ extraArgs:
524
+ "feature-gates": "$gates "
525
+ scheduler:
526
+ extraArgs:
527
+ "feature-gates": "$gates "
528
+ - |
529
+ apiVersion: kubeadm.k8s.io/v1beta2
530
+ kind: InitConfiguration
531
+ metadata:
532
+ name: config
533
+ nodeRegistration:
534
+ kubeletExtraArgs:
535
+ "feature-gates": "$gates "
536
+ - |
537
+ apiVersion: kubeproxy.config.k8s.io/v1alpha1
538
+ kind: KubeProxyConfiguration
539
+ metadata:
540
+ name: config
541
+ featureGates:
499
542
$( list_gates " $gates " )
500
543
EOF
544
+ fi
545
+
501
546
info " kind-config.yaml:"
502
547
cat " ${CSI_PROW_WORK} /kind-config.yaml"
503
548
if ! run kind create cluster --name csi-prow --config " ${CSI_PROW_WORK} /kind-config.yaml" --wait 5m --image " $image " ; then
0 commit comments