Skip to content

Commit 830300d

Browse files
committed
Fix release-tools/prow.sh for K8s 1.20
Signed-off-by: ialidzhikov <[email protected]>
1 parent 7819ee3 commit 830300d

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

.prow.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This is specific to the release-2.1 branch and overrides the
44
# version set in the prow config.
55
export CSI_SNAPSHOTTER_VERSION=v2.1.2
6+
export CSI_PROW_DRIVER_VERSION=v1.4.0
67

78
. release-tools/prow.sh
89

release-tools/prow.sh

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ get_versioned_variable () {
6565
echo "$value"
6666
}
6767

68+
# This takes a version string like CSI_PROW_KUBERNETES_VERSION and
69+
# maps it to the corresponding git tag, branch or commit.
70+
version_to_git () {
71+
version="$1"
72+
shift
73+
case "$version" in
74+
latest|master) echo "master";;
75+
release-*) echo "$version";;
76+
*) echo "v$version";;
77+
esac
78+
}
79+
6880
# Note that in the release-2.1 branch the s390x architecture is not supported.
6981
configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux arm64 -arm64" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries"
7082

@@ -210,16 +222,7 @@ configvar CSI_PROW_DRIVER_CANARY_REGISTRY "gcr.io/k8s-staging-sig-storage" "regi
210222
# all generated files are present.
211223
#
212224
# CSI_PROW_E2E_REPO=none disables E2E testing.
213-
tag_from_version () {
214-
version="$1"
215-
shift
216-
case "$version" in
217-
latest) echo "master";;
218-
release-*) echo "$version";;
219-
*) echo "v$version";;
220-
esac
221-
}
222-
configvar CSI_PROW_E2E_VERSION "$(tag_from_version "${CSI_PROW_KUBERNETES_VERSION}")" "E2E version"
225+
configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION}")" "E2E version"
223226
configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo"
224227
configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package"
225228

@@ -468,20 +471,22 @@ git_checkout () {
468471

469472
# This clones a repo ("https://github.com/kubernetes/kubernetes")
470473
# in a certain location ("$GOPATH/src/k8s.io/kubernetes") at
471-
# a the head of a specific branch (i.e., release-1.13, master).
472-
# The directory cannot exist.
473-
git_clone_branch () {
474-
local repo path branch parent
474+
# a the head of a specific branch (i.e., release-1.13, master),
475+
# tag (v1.20.0) or commit.
476+
#
477+
# The directory must not exist.
478+
git_clone () {
479+
local repo path name parent
475480
repo="$1"
476481
shift
477482
path="$1"
478483
shift
479-
branch="$1"
484+
name="$1"
480485
shift
481486

482487
parent="$(dirname "$path")"
483488
mkdir -p "$parent"
484-
(cd "$parent" && run git clone --single-branch --branch "$branch" "$repo" "$path") || die "cloning $repo" failed
489+
(cd "$parent" && run git clone --single-branch --branch "$name" "$repo" "$path") || die "cloning $repo" failed
485490
# This is useful for local testing or when switching between different revisions in the same
486491
# repo.
487492
(cd "$path" && run git clean -fdx) || die "failed to clean $path"
@@ -570,7 +575,7 @@ start_cluster () {
570575
else
571576
type="docker"
572577
fi
573-
git_clone_branch https://github.com/kubernetes/kubernetes "${CSI_PROW_WORK}/src/kubernetes" "$version" || die "checking out Kubernetes $version failed"
578+
git_clone https://github.com/kubernetes/kubernetes "${CSI_PROW_WORK}/src/kubernetes" "$(version_to_git "$version")" || die "checking out Kubernetes $version failed"
574579

575580
go_version="$(go_version_for_kubernetes "${CSI_PROW_WORK}/src/kubernetes" "$version")" || die "cannot proceed without knowing Go version for Kubernetes"
576581
# Changing into the Kubernetes source code directory is a workaround for https://github.com/kubernetes-sigs/kind/issues/1910

0 commit comments

Comments
 (0)