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
1d60e77 Merge pull request kubernetes-csi#131 from pohly/kubernetes-1.20-tag
9f10459 prow.sh: support building Kubernetes for a specific version
fe1f284 Merge pull request kubernetes-csi#121 from kvaps/namespace-check
8fdf0f7 Merge pull request kubernetes-csi#128 from fengzixu/master
1c94220 fix: fix a bug of csi-sanity
a4c41e6 Merge pull request kubernetes-csi#127 from pohly/fix-boilerplate
ece0f50 check namespace for snapshot-controller
dbd8967 verify-boilerplate.sh: fix path to script
git-subtree-dir: release-tools
git-subtree-split: 1d60e77
Copy file name to clipboardExpand all lines: prow.sh
+31-25Lines changed: 31 additions & 25 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) echo"master";;
75
+
release-*) echo"$version";;
76
+
*) echo"v$version";;
77
+
esac
78
+
}
79
+
68
80
configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux s390x -s390x; linux arm64 -arm64""Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries"
69
81
70
82
# If we have a vendor directory, then use it. We must be careful to only
configvar CSI_PROW_SANITY_SERVICE "hostpath-service""Kubernetes TCP service name that exposes csi.sock"
233
236
configvar CSI_PROW_SANITY_POD "csi-hostpathplugin-0""Kubernetes pod with CSI driver"
234
237
configvar CSI_PROW_SANITY_CONTAINER "hostpath""Kubernetes container with CSI driver"
@@ -465,20 +468,22 @@ git_checkout () {
465
468
466
469
# This clones a repo ("https://github.com/kubernetes/kubernetes")
467
470
# in a certain location ("$GOPATH/src/k8s.io/kubernetes") at
468
-
# a the head of a specific branch (i.e., release-1.13, master).
469
-
# The directory cannot exist.
470
-
git_clone_branch () {
471
-
local repo path branch parent
471
+
# a the head of a specific branch (i.e., release-1.13, master),
472
+
# tag (v1.20.0) or commit.
473
+
#
474
+
# The directory must not exist.
475
+
git_clone () {
476
+
local repo path name parent
472
477
repo="$1"
473
478
shift
474
479
path="$1"
475
480
shift
476
-
branch="$1"
481
+
name="$1"
477
482
shift
478
483
479
484
parent="$(dirname "$path")"
480
485
mkdir -p "$parent"
481
-
(cd "$parent"&& run git clone --single-branch --branch "$branch""$repo""$path") || die "cloning $repo" failed
486
+
(cd "$parent"&& run git clone --single-branch --branch "$name""$repo""$path") || die "cloning $repo" failed
482
487
# This is useful for local testing or when switching between different revisions in the same
483
488
# repo.
484
489
(cd "$path"&& run git clean -fdx) || die "failed to clean $path"
@@ -567,7 +572,7 @@ start_cluster () {
567
572
else
568
573
type="docker"
569
574
fi
570
-
git_clone_branch https://github.com/kubernetes/kubernetes "${CSI_PROW_WORK}/src/kubernetes""$version"|| die "checking out Kubernetes $version failed"
575
+
git_clone https://github.com/kubernetes/kubernetes "${CSI_PROW_WORK}/src/kubernetes""$(version_to_git "$version")"|| die "checking out Kubernetes $version failed"
571
576
572
577
go_version="$(go_version_for_kubernetes "${CSI_PROW_WORK}/src/kubernetes""$version")"|| die "cannot proceed without knowing Go version for Kubernetes"
573
578
# Changing into the Kubernetes source code directory is a workaround for https://github.com/kubernetes-sigs/kind/issues/1910
echo >&2 "ERROR: snapshot controller not ready after over 5 min"
810
816
exit 1
811
817
fi
@@ -879,8 +885,8 @@ install_sanity () (
879
885
return
880
886
fi
881
887
882
-
git_checkout "${CSI_PROW_SANITY_REPO}""${GOPATH}/src/${CSI_PROW_SANITY_IMPORT_PATH}""${CSI_PROW_SANITY_VERSION}" --depth=1 || die "checking out csi-sanity failed"
883
-
run_with_go "${CSI_PROW_GO_VERSION_SANITY}" go test -c -o "${CSI_PROW_WORK}/csi-sanity""${CSI_PROW_SANITY_IMPORT_PATH}/cmd/csi-sanity"|| die "building csi-sanity failed"
888
+
git_checkout "${CSI_PROW_SANITY_REPO}""${GOPATH}/src/${CSI_PROW_SANITY_PACKAGE_PATH}""${CSI_PROW_SANITY_VERSION}" --depth=1 || die "checking out csi-sanity failed"
889
+
( cd"${GOPATH}/src/${CSI_PROW_SANITY_PACKAGE_PATH}/cmd/csi-sanity"&&run_with_go "${CSI_PROW_GO_VERSION_SANITY}" go build -o "${CSI_PROW_WORK}/csi-sanity")|| die "building csi-sanity failed"
884
890
)
885
891
886
892
# Captures pod output while running some other command.
0 commit comments