You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: release-tools/prow.sh
+22-17Lines changed: 22 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,18 @@ get_versioned_variable () {
65
65
echo"$value"
66
66
}
67
67
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
+
68
80
# Note that in the release-2.1 branch the s390x architecture is not supported.
69
81
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"
# This clones a repo ("https://github.com/kubernetes/kubernetes")
470
473
# 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
475
480
repo="$1"
476
481
shift
477
482
path="$1"
478
483
shift
479
-
branch="$1"
484
+
name="$1"
480
485
shift
481
486
482
487
parent="$(dirname "$path")"
483
488
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
485
490
# This is useful for local testing or when switching between different revisions in the same
486
491
# repo.
487
492
(cd "$path"&& run git clean -fdx) || die "failed to clean $path"
@@ -570,7 +575,7 @@ start_cluster () {
570
575
else
571
576
type="docker"
572
577
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"
574
579
575
580
go_version="$(go_version_for_kubernetes "${CSI_PROW_WORK}/src/kubernetes""$version")"|| die "cannot proceed without knowing Go version for Kubernetes"
576
581
# Changing into the Kubernetes source code directory is a workaround for https://github.com/kubernetes-sigs/kind/issues/1910
0 commit comments