Skip to content

Commit f4f73ce

Browse files
authored
Merge pull request kubernetes-csi#21 from msau42/add-1.15-jobs
Add 1.15 jobs
2 parents db8abb6 + 4e31f07 commit f4f73ce

File tree

1 file changed

+78
-33
lines changed

1 file changed

+78
-33
lines changed

prow.sh

+78-33
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ configvar () {
5252
eval echo "\$3:" "$1=\${$1}"
5353
}
5454

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+
5575
# Prints the value of a variable + version suffix, falling back to variable + "LATEST".
5676
get_versioned_variable () {
5777
local var="$1"
@@ -81,7 +101,7 @@ configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version
81101
# kind version to use. If the pre-installed version is different,
82102
# the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases/download/
83103
# (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"
85105

86106
# ginkgo test runner version to use. If the pre-installed version is
87107
# different, the desired version is built from source.
@@ -108,6 +128,18 @@ configvar CSI_PROW_BUILD_JOB true "building code in repo enabled"
108128
# deprecating or changing the implementation of an alpha feature.
109129
configvar CSI_PROW_KUBERNETES_VERSION 1.13.3 "Kubernetes"
110130

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+
111143
# CSI_PROW_KUBERNETES_VERSION reduced to first two version numbers and
112144
# with underscore (1_13 instead of 1.13.3) and in uppercase (LATEST
113145
# instead of latest).
@@ -151,10 +183,10 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
151183
#
152184
# When no deploy script is found (nothing in `deploy` directory,
153185
# 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"
155187
configvar CSI_PROW_HOSTPATH_REPO https://github.com/kubernetes-csi/csi-driver-host-path "hostpath repo"
156188
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"
158190

159191
# If CSI_PROW_HOSTPATH_CANARY is set (typically to "canary", but also
160192
# "1.0-canary"), then all image versions are replaced with that
@@ -170,6 +202,7 @@ configvar CSI_PROW_HOSTPATH_CANARY "" "hostpath image"
170202
# CSI_PROW_E2E_REPO=none disables E2E testing.
171203
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
172204
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"
173206
# TODO: add new CSI_PROW_E2E_VERSION entry for future Kubernetes releases
174207
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
175208
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
277310
# it anymore for older releases.
278311
configvar CSI_PROW_E2E_ALPHA_GATES_1_13 'VolumeSnapshotDataSource=true,BlockVolume=true,CSIBlockVolume=true' "alpha feature gates for Kubernetes 1.13"
279312
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"
280314
# TODO: add new CSI_PROW_ALPHA_GATES_xxx entry for future Kubernetes releases and
281315
# add new gates to CSI_PROW_E2E_ALPHA_GATES_LATEST.
282316
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST 'VolumeSnapshotDataSource=true,ExpandCSIVolumes=true' "alpha feature gates for latest Kubernetes"
@@ -464,40 +498,51 @@ start_cluster () {
464498
image="kindest/node:v${CSI_PROW_KUBERNETES_VERSION}"
465499
fi
466500
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
469503
nodes:
470504
- 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:
499542
$(list_gates "$gates")
500543
EOF
544+
fi
545+
501546
info "kind-config.yaml:"
502547
cat "${CSI_PROW_WORK}/kind-config.yaml"
503548
if ! run kind create cluster --name csi-prow --config "${CSI_PROW_WORK}/kind-config.yaml" --wait 5m --image "$image"; then

0 commit comments

Comments
 (0)