Skip to content

Commit f66419b

Browse files
committed
Squashed 'release-tools/' changes from 4967685..406a79ac
406a79ac Merge pull request kubernetes-csi#267 from huww98/gomodcache 9cec273d Set GOMODCACHE to avoid re-download toolchain 98f23071 Merge pull request kubernetes-csi#260 from TerryHowe/update-csi-driver-version e9d8712d Merge pull request kubernetes-csi#259 from stmcginnis/deprecated-kind-kube-root faf79ff6 Remove --kube-root deprecated kind argument 734c2b95 Merge pull request kubernetes-csi#265 from Rakshith-R/consider-main-branch f95c855b Merge pull request kubernetes-csi#262 from huww98/golang-toolchain 3c8d966f Treat main branch as equivalent to master branch e31de525 Merge pull request kubernetes-csi#261 from huww98/golang fd153a9e Bump golang to 1.23.1 a8b3d050 pull-test.sh: fix "git subtree pull" errors 6b05f0fc use new GOTOOLCHAIN env to manage go version 18b6ac6d chore: update CSI driver version to 1.15 227577e Merge pull request kubernetes-csi#258 from gnufied/enable-race-detection e1ceee2 Always enable race detection while running tests 988496a Merge pull request kubernetes-csi#257 from jakobmoellerdev/csi-prow-sidecar-e2e-path 028f8c6 chore: bump to Go 1.22.5 69bd71e chore: add CSI_PROW_SIDECAR_E2E_PATH f40f0cc Merge pull request kubernetes-csi#256 from solumath/master cfa9210 Instruction update 379a1bb Merge pull request kubernetes-csi#255 from humblec/sidecar-md a5667bb fix typo in sidecar release process git-subtree-dir: release-tools git-subtree-split: 406a79acf021b5564108afebeea7d0ed44648d3f
1 parent fbb7a9a commit f66419b

5 files changed

+41
-27
lines changed

SIDECAR_RELEASE_PROCESS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
8484
1. Compare the generated output to the new commits for the release to check if
8585
any notable change missed a release note.
8686
1. Reword release notes as needed, ideally in the original PRs so that the
87-
release notes can be regnerated. Make sure to check notes for breaking
87+
release notes can be regenerated. Make sure to check notes for breaking
8888
changes and deprecations.
8989
1. If release is a new major/minor version, create a new `CHANGELOG-<major>.<minor>.md`
9090
file.

build.make

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ REV=$(shell git describe --long --tags --match='v*' --dirty 2>/dev/null || git r
4545
# Determined dynamically.
4646
IMAGE_TAGS=
4747

48-
# A "canary" image gets built if the current commit is the head of the remote "master" branch.
48+
# A "canary" image gets built if the current commit is the head of the remote "master" or "main" branch.
4949
# That branch does not exist when building some other branch in TravisCI.
5050
IMAGE_TAGS+=$(shell if [ "$$(git rev-list -n1 HEAD)" = "$$(git rev-list -n1 origin/master 2>/dev/null)" ]; then echo "canary"; fi)
51+
IMAGE_TAGS+=$(shell if [ "$$(git rev-list -n1 HEAD)" = "$$(git rev-list -n1 origin/main 2>/dev/null)" ]; then echo "canary"; fi)
5152

5253
# A "X.Y.Z-canary" image gets built if the current commit is the head of a "origin/release-X.Y.Z" branch.
5354
# The actual suffix does not matter, only the "release-" prefix is checked.
@@ -62,9 +63,9 @@ IMAGE_NAME=$(REGISTRY_NAME)/$*
6263

6364
ifdef V
6465
# Adding "-alsologtostderr" assumes that all test binaries contain glog. This is not guaranteed.
65-
TESTARGS = -v -args -alsologtostderr -v 5
66+
TESTARGS = -race -v -args -alsologtostderr -v 5
6667
else
67-
TESTARGS =
68+
TESTARGS = -race
6869
endif
6970

7071
# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
@@ -143,7 +144,7 @@ DOCKER_BUILDX_CREATE_ARGS ?=
143144
# Windows binaries can be built before adding a Dockerfile for it.
144145
#
145146
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
146-
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
147+
# PULL_BASE_REF must be set to 'master', 'main', 'release-x.y', or a tag name, and determines
147148
# the tag for the resulting multiarch image.
148149
$(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
149150
set -ex; \
@@ -191,7 +192,7 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
191192
done; \
192193
docker manifest push -p $(IMAGE_NAME):$$tag; \
193194
}; \
194-
if [ $(PULL_BASE_REF) = "master" ]; then \
195+
if [ $(PULL_BASE_REF) = "master" ] || [ $(PULL_BASE_REF) = "main" ]; then \
195196
: "creating or overwriting canary image"; \
196197
pushMultiArch canary; \
197198
elif echo $(PULL_BASE_REF) | grep -q -e 'release-*' ; then \
@@ -209,7 +210,7 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
209210
.PHONY: check-pull-base-ref
210211
check-pull-base-ref:
211212
if ! [ "$(PULL_BASE_REF)" ]; then \
212-
echo >&2 "ERROR: PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name."; \
213+
echo >&2 "ERROR: PULL_BASE_REF must be set to 'master', 'main', 'release-x.y', or a tag name."; \
213214
exit 1; \
214215
fi
215216

generate-patch-release-notes.sh

+10-6
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@
2323
# CSI_RELEASE_TOKEN: Github token needed for generating release notes
2424
# GITHUB_USER: Github username to create PRs with
2525
#
26+
# Required tools:
27+
# - gh
28+
# - release-notes (https://github.com/kubernetes/release/blob/master/cmd/release-notes/README.md)
29+
#
2630
# Instructions:
27-
# 1. Login with "gh auth login"
28-
# 2. Copy this script to the kubernetes-csi directory (one directory above the
29-
# repos)
30-
# 3. Update the repos and versions in the $releases array
31-
# 4. Set environment variables
32-
# 5. Run script from the kubernetes-csi directory
31+
# 1. Install the required tools
32+
# 2. Login with "gh auth login"
33+
# 3. Copy this script to the kubernetes-csi directory (one directory above the repos)
34+
# 4. Update the repos and versions in the $releases array
35+
# 5. Set environment variables
36+
# 6. Run script from the kubernetes-csi directory
3337
#
3438
# Caveats:
3539
# - This script doesn't handle regenerating and updating existing PRs yet.

prow.sh

+18-14
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.22.3" "Go version for building the component" # depends on component's source code
89+
configvar CSI_PROW_GO_VERSION_BUILD "1.23.1" "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
@@ -199,7 +199,7 @@ kindest/node:v1.18.20@sha256:738cdc23ed4be6cc0b7ea277a2ebcc454c8373d7d8fb991a7fc
199199
# If the deployment script is called with CSI_PROW_TEST_DRIVER=<file name> as
200200
# environment variable, then it must write a suitable test driver configuration
201201
# into that file in addition to installing the driver.
202-
configvar CSI_PROW_DRIVER_VERSION "v1.12.0" "CSI driver version"
202+
configvar CSI_PROW_DRIVER_VERSION "v1.15.0" "CSI driver version"
203203
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo"
204204
configvar CSI_PROW_DEPLOYMENT "" "deployment"
205205
configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files"
@@ -231,8 +231,11 @@ configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION}
231231
configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo"
232232
configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package"
233233

234-
# Local path for e2e tests. Set to "none" to disable.
235-
configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package"
234+
# Local path & package path for e2e tests. Set to "none" to disable.
235+
# When using versioned go modules, the import path is the module path whereas the path
236+
# should not contain the version and be the directory where the module is checked out.
237+
configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package (go import path)"
238+
configvar CSI_PROW_SIDECAR_E2E_PATH "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" "CSI Sidecar E2E path (directory)"
236239

237240
# csi-sanity testing from the csi-test repo can be run against the installed
238241
# CSI driver. For this to work, deploying the driver must expose the Unix domain
@@ -422,23 +425,24 @@ die () {
422425
exit 1
423426
}
424427

425-
# Ensure that PATH has the desired version of the Go tools, then run command given as argument.
428+
# Ensure we use the desired version of the Go tools, then run command given as argument.
426429
# Empty parameter uses the already installed Go. In Prow, that version is kept up-to-date by
427430
# bumping the container image regularly.
428431
run_with_go () {
429432
local version
430433
version="$1"
431434
shift
432435

433-
if ! [ "$version" ] || go version 2>/dev/null | grep -q "go$version"; then
434-
run "$@"
435-
else
436-
if ! [ -d "${CSI_PROW_WORK}/go-$version" ]; then
437-
run curl --fail --location "https://dl.google.com/go/go$version.linux-amd64.tar.gz" | tar -C "${CSI_PROW_WORK}" -zxf - || die "installation of Go $version failed"
438-
mv "${CSI_PROW_WORK}/go" "${CSI_PROW_WORK}/go-$version"
436+
if [ "$version" ]; then
437+
version=go$version
438+
if [ "$(GOTOOLCHAIN=$version go version | cut -d' ' -f3)" != "$version" ]; then
439+
die "Please install Go 1.21+"
439440
fi
440-
PATH="${CSI_PROW_WORK}/go-$version/bin:$PATH" run "$@"
441+
else
442+
version=local
441443
fi
444+
# Set GOMODCACHE to make sure Kubernetes does not need to download again.
445+
GOTOOLCHAIN=$version GOMODCACHE="$(go env GOMODCACHE)" run "$@"
442446
}
443447

444448
# Ensure that we have the desired version of kind.
@@ -621,7 +625,7 @@ start_cluster () {
621625
go_version="$(go_version_for_kubernetes "${CSI_PROW_WORK}/src/kubernetes" "$version")" || die "cannot proceed without knowing Go version for Kubernetes"
622626
# Changing into the Kubernetes source code directory is a workaround for https://github.com/kubernetes-sigs/kind/issues/1910
623627
# shellcheck disable=SC2046
624-
(cd "${CSI_PROW_WORK}/src/kubernetes" && run_with_go "$go_version" kind build node-image --image csiprow/node:latest --kube-root "${CSI_PROW_WORK}/src/kubernetes") || die "'kind build node-image' failed"
628+
(cd "${CSI_PROW_WORK}/src/kubernetes" && run_with_go "$go_version" kind build node-image "${CSI_PROW_WORK}/src/kubernetes" --image csiprow/node:latest) || die "'kind build node-image' failed"
625629
csi_prow_kind_have_kubernetes=true
626630
fi
627631
image="csiprow/node:latest"
@@ -1035,7 +1039,7 @@ run_e2e () (
10351039
trap move_junit EXIT
10361040
10371041
if [ "${name}" == "local" ]; then
1038-
cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" &&
1042+
cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_PATH}" &&
10391043
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 --timeout="${CSI_PROW_GINKGO_TIMEOUT}" -v "$@" "${CSI_PROW_WORK}/e2e-local.test" -- -report-dir "${ARTIFACTS}" -report-prefix local
10401044
else
10411045
cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&

pull-test.sh

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
set -ex
2222

23+
# Prow checks out repos with --filter=blob:none. This breaks
24+
# "git subtree pull" unless we enable fetching missing file content.
25+
GIT_NO_LAZY_FETCH=0
26+
export GIT_NO_LAZY_FETCH
27+
2328
# It must be called inside the updated csi-release-tools repo.
2429
CSI_RELEASE_TOOLS_DIR="$(pwd)"
2530

0 commit comments

Comments
 (0)