Skip to content

Commit 5492a6c

Browse files
authored
Merge pull request #812 from jsafrane/prow-update-release-3.1
release-3.1: update release-tools
2 parents ae25241 + 9363f28 commit 5492a6c

File tree

4 files changed

+84
-48
lines changed

4 files changed

+84
-48
lines changed

pkg/controller/controller.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import (
5959
snapclientset "github.com/kubernetes-csi/external-snapshotter/client/v4/clientset/versioned"
6060
)
6161

62-
//secretParamsMap provides a mapping of current as well as deprecated secret keys
62+
// secretParamsMap provides a mapping of current as well as deprecated secret keys
6363
type secretParamsMap struct {
6464
name string
6565
deprecatedSecretNameKey string
@@ -1273,7 +1273,7 @@ func (p *csiProvisioner) ShouldProvision(ctx context.Context, claim *v1.Persiste
12731273
return true
12741274
}
12751275

1276-
//TODO use a unique volume handle from and to Id
1276+
// TODO use a unique volume handle from and to Id
12771277
func (p *csiProvisioner) volumeIdToHandle(id string) string {
12781278
return id
12791279
}
@@ -1586,7 +1586,9 @@ func verifyAndGetSecretNameAndNamespaceTemplate(secret secretParamsMap, storageC
15861586
}
15871587

15881588
// getSecretReference returns a reference to the secret specified in the given nameTemplate
1589-
// and namespaceTemplate, or an error if the templates are not specified correctly.
1589+
//
1590+
// and namespaceTemplate, or an error if the templates are not specified correctly.
1591+
//
15901592
// no lookup of the referenced secret is performed, and the secret may or may not exist.
15911593
//
15921594
// supported tokens for name resolution:

pkg/controller/topology.go

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,23 @@ func SupportsTopology(pluginCapabilities rpc.PluginCapabilitySet) bool {
115115
//
116116
// 1) selectedNode is not set (immediate binding):
117117
//
118-
// In this case, we list all CSINode objects to find a Node that
119-
// the driver has registered topology keys with.
118+
// In this case, we list all CSINode objects to find a Node that
119+
// the driver has registered topology keys with.
120120
//
121-
// Once we get the list of CSINode objects, we find one that has
122-
// topology keys registered. If none are found, then we assume
123-
// that the driver has not started on any node yet, and we error
124-
// and retry.
121+
// Once we get the list of CSINode objects, we find one that has
122+
// topology keys registered. If none are found, then we assume
123+
// that the driver has not started on any node yet, and we error
124+
// and retry.
125125
//
126-
// If at least one CSINode object is found with topology keys,
127-
// then we continue and use that for assembling the topology
128-
// requirement. The available topologies will be limited to the
129-
// Nodes that the driver has registered with.
126+
// If at least one CSINode object is found with topology keys,
127+
// then we continue and use that for assembling the topology
128+
// requirement. The available topologies will be limited to the
129+
// Nodes that the driver has registered with.
130130
//
131131
// 2) selectedNode is set (delayed binding):
132132
//
133-
// We will get the topology from the CSINode object for the selectedNode
134-
// and error if we can't (and retry).
135-
//
133+
// We will get the topology from the CSINode object for the selectedNode
134+
// and error if we can't (and retry).
136135
func GenerateAccessibilityRequirements(
137136
kubeClient kubernetes.Interface,
138137
driverName string,
@@ -380,21 +379,28 @@ func aggregateTopologies(
380379
// This function eliminates the OR of topology values by distributing the OR over the AND a level
381380
// higher.
382381
// For example, given a TopologySelectorTerm of this form:
383-
// {
384-
// "zone": { "zone1", "zone2" },
385-
// "rack": { "rackA", "rackB" },
386-
// }
382+
//
383+
// {
384+
// "zone": { "zone1", "zone2" },
385+
// "rack": { "rackA", "rackB" },
386+
// }
387+
//
387388
// Abstractly it could be viewed as:
388-
// (zone1 OR zone2) AND (rackA OR rackB)
389+
//
390+
// (zone1 OR zone2) AND (rackA OR rackB)
391+
//
389392
// Distributing the OR over the AND, we get:
390-
// (zone1 AND rackA) OR (zone2 AND rackA) OR (zone1 AND rackB) OR (zone2 AND rackB)
393+
//
394+
// (zone1 AND rackA) OR (zone2 AND rackA) OR (zone1 AND rackB) OR (zone2 AND rackB)
395+
//
391396
// which in the intermediate representation returned by this function becomes:
392-
// [
393-
// { "zone": "zone1", "rack": "rackA" },
394-
// { "zone": "zone2", "rack": "rackA" },
395-
// { "zone": "zone1", "rack": "rackB" },
396-
// { "zone": "zone2", "rack": "rackB" },
397-
// ]
397+
//
398+
// [
399+
// { "zone": "zone1", "rack": "rackA" },
400+
// { "zone": "zone2", "rack": "rackA" },
401+
// { "zone": "zone1", "rack": "rackB" },
402+
// { "zone": "zone2", "rack": "rackB" },
403+
// ]
398404
//
399405
// This flattening is then applied to all TopologySelectorTerms in AllowedTopologies, and
400406
// the resulting terms are OR'd together.
@@ -524,7 +530,7 @@ func (t topologyTerm) clone() topologyTerm {
524530
// - com.example.csi/rack#zz < com.example.csi/zone#zone1
525531
// - com.example.csi/z#z1 < com.example.csi/zone#zone1
526532
// - com.example.csi/rack#rackA,com.example.csi/zone#zone2 < com.example.csi/rackB,com.example.csi/zone#zone1
527-
// Note that both '#' and ',' are less than '/', '-', '_', '.', [A-Z0-9a-z]
533+
// Note that both '#' and ',' are less than '/', '-', '_', '.', [A-Z0-9a-z]
528534
func (t topologyTerm) hash() string {
529535
var segments []string
530536
for k, v := range t {

release-tools/KUBERNETES_CSI_OWNERS_ALIASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ aliases:
2727
- jingxu97
2828
- jsafrane
2929
- pohly
30+
- RaunakShah
3031
- xing-yang
3132

3233
# This documents who previously contributed to Kubernetes-CSI

release-tools/prow.sh

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp
8686
# which is disabled with GOFLAGS=-mod=vendor).
8787
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"
8888

89-
configvar CSI_PROW_GO_VERSION_BUILD "1.18" "Go version for building the component" # depends on component's source code
89+
configvar CSI_PROW_GO_VERSION_BUILD "1.19" "Go version for building the component" # depends on component's source code
9090
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
9191
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
9292
configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below
@@ -121,7 +121,7 @@ configvar CSI_PROW_BUILD_JOB true "building code in repo enabled"
121121
# use the same settings as for "latest" Kubernetes. This works
122122
# as long as there are no breaking changes in Kubernetes, like
123123
# deprecating or changing the implementation of an alpha feature.
124-
configvar CSI_PROW_KUBERNETES_VERSION 1.17.0 "Kubernetes"
124+
configvar CSI_PROW_KUBERNETES_VERSION 1.22.0 "Kubernetes"
125125

126126
# CSI_PROW_KUBERNETES_VERSION reduced to first two version numbers and
127127
# with underscore (1_13 instead of 1.13.3) and in uppercase (LATEST
@@ -141,7 +141,7 @@ kind_version_default () {
141141
latest|master)
142142
echo main;;
143143
*)
144-
echo v0.11.1;;
144+
echo v0.14.0;;
145145
esac
146146
}
147147

@@ -152,16 +152,13 @@ configvar CSI_PROW_KIND_VERSION "$(kind_version_default)" "kind"
152152

153153
# kind images to use. Must match the kind version.
154154
# The release notes of each kind release list the supported images.
155-
configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
156-
kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047
157-
kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
158-
kindest/node:v1.20.7@sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9
159-
kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
160-
kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c
161-
kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00
162-
kindest/node:v1.16.15@sha256:83067ed51bf2a3395b24687094e283a7c7c865ccc12a8b1d7aa673ba0c5e8861
163-
kindest/node:v1.15.12@sha256:b920920e1eda689d9936dfcf7332701e80be12566999152626b2c9d730397a95
164-
kindest/node:v1.14.10@sha256:f8a66ef82822ab4f7569e91a5bccaf27bceee135c1457c512e54de8c6f7219f8" "kind images"
155+
configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
156+
kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
157+
kindest/node:v1.22.9@sha256:8135260b959dfe320206eb36b3aeda9cffcb262f4b44cda6b33f7bb73f453105
158+
kindest/node:v1.21.12@sha256:f316b33dd88f8196379f38feb80545ef3ed44d9197dca1bfd48bcb1583210207
159+
kindest/node:v1.20.15@sha256:6f2d011dffe182bad80b85f6c00e8ca9d86b5b8922cdf433d53575c4c5212248
160+
kindest/node:v1.19.16@sha256:d9c819e8668de8d5030708e484a9fdff44d95ec4675d136ef0a0a584e587f65c
161+
kindest/node:v1.18.20@sha256:738cdc23ed4be6cc0b7ea277a2ebcc454c8373d7d8fb991a7fcdbd126188e6d7" "kind images"
165162

166163
# By default, this script tests sidecars with the CSI hostpath driver,
167164
# using the install_csi_driver function. That function depends on
@@ -231,6 +228,9 @@ configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION}
231228
configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo"
232229
configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package"
233230

231+
# Local path for e2e tests. Set to "none" to disable.
232+
configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package"
233+
234234
# csi-sanity testing from the csi-test repo can be run against the installed
235235
# CSI driver. For this to work, deploying the driver must expose the Unix domain
236236
# csi.sock as a TCP service for use by the csi-sanity command, which runs outside
@@ -285,13 +285,18 @@ tests_enabled () {
285285
sanity_enabled () {
286286
[ "${CSI_PROW_TESTS_SANITY}" = "sanity" ] && tests_enabled "sanity"
287287
}
288+
289+
sidecar_tests_enabled () {
290+
[ "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" != "none" ]
291+
}
292+
288293
tests_need_kind () {
289294
tests_enabled "parallel" "serial" "serial-alpha" "parallel-alpha" ||
290-
sanity_enabled
295+
sanity_enabled || sidecar_tests_enabled
291296
}
292297
tests_need_non_alpha_cluster () {
293298
tests_enabled "parallel" "serial" ||
294-
sanity_enabled
299+
sanity_enabled || sidecar_tests_enabled
295300
}
296301
tests_need_alpha_cluster () {
297302
tests_enabled "parallel-alpha" "serial-alpha"
@@ -355,12 +360,17 @@ configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_
355360
configvar CSI_PROW_E2E_GATES_LATEST '' "non alpha feature gates for latest Kubernetes"
356361
configvar CSI_PROW_E2E_GATES "$(get_versioned_variable CSI_PROW_E2E_GATES "${csi_prow_kubernetes_version_suffix}")" "non alpha E2E feature gates"
357362

363+
# Focus for local tests run in the sidecar E2E repo. Only used if CSI_PROW_SIDECAR_E2E_IMPORT_PATH
364+
# is not set to "none". If empty, all tests in the sidecar repo will be run.
365+
configvar CSI_PROW_SIDECAR_E2E_FOCUS '' "tags for local E2E tests"
366+
configvar CSI_PROW_SIDECAR_E2E_SKIP '' "local tests that need to be skipped"
367+
358368
# Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment
359369
default_csi_snapshotter_version () {
360370
if [ "${CSI_PROW_KUBERNETES_VERSION}" = "latest" ] || [ "${CSI_PROW_DRIVER_CANARY}" = "canary" ]; then
361371
echo "master"
362372
else
363-
echo "v3.0.2"
373+
echo "v4.0.0"
364374
fi
365375
}
366376
configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external-snapshotter version tag"
@@ -371,7 +381,7 @@ configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external
371381
# whether they can run with the current cluster provider, but until
372382
# they are, we filter them out by name. Like the other test selection
373383
# variables, this is again a space separated list of regular expressions.
374-
configvar CSI_PROW_E2E_SKIP 'Disruptive' "tests that need to be skipped"
384+
configvar CSI_PROW_E2E_SKIP '\[Disruptive\]|\[Feature:SELinux\]' "tests that need to be skipped"
375385

376386
# This creates directories that are required for testing.
377387
ensure_paths () {
@@ -945,6 +955,9 @@ install_e2e () {
945955
return
946956
fi
947957
958+
if sidecar_tests_enabled; then
959+
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" go test -c -o "${CSI_PROW_WORK}/e2e-local.test" "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}"
960+
fi
948961
git_checkout "${CSI_PROW_E2E_REPO}" "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_E2E_VERSION}" --depth=1 &&
949962
if [ "${CSI_PROW_E2E_IMPORT_PATH}" = "k8s.io/kubernetes" ]; then
950963
patch_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_WORK}" &&
@@ -1000,8 +1013,13 @@ run_e2e () (
10001013
}
10011014
trap move_junit EXIT
10021015
1003-
cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
1004-
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e.test" -- -report-dir "${ARTIFACTS}" -storage.testdriver="${CSI_PROW_WORK}/test-driver.yaml"
1016+
if [ "${name}" == "local" ]; then
1017+
cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" &&
1018+
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e-local.test" -- -report-dir "${ARTIFACTS}" -report-prefix local
1019+
else
1020+
cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
1021+
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e.test" -- -report-dir "${ARTIFACTS}" -storage.testdriver="${CSI_PROW_WORK}/test-driver.yaml"
1022+
fi
10051023
)
10061024
10071025
# Run csi-sanity against installed CSI driver.
@@ -1313,6 +1331,15 @@ main () {
13131331
ret=1
13141332
fi
13151333
fi
1334+
1335+
if sidecar_tests_enabled; then
1336+
if ! run_e2e local \
1337+
-focus="${CSI_PROW_SIDECAR_E2E_FOCUS}" \
1338+
-skip="$(regex_join "${CSI_PROW_E2E_SERIAL}")"; then
1339+
warn "E2E sidecar failed"
1340+
ret=1
1341+
fi
1342+
fi
13161343
fi
13171344
delete_cluster_inside_prow_job non-alpha
13181345
fi

0 commit comments

Comments
 (0)