@@ -101,7 +101,7 @@ configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version
101
101
# kind version to use. If the pre-installed version is different,
102
102
# the desired version is downloaded from https://github.com/kubernetes-sigs/kind/releases/download/
103
103
# (if available), otherwise it is built from source.
104
- configvar CSI_PROW_KIND_VERSION v0.4.0 " kind"
104
+ configvar CSI_PROW_KIND_VERSION 2555d8e09d5a77ee718414cec9f6083dfa028dc5 " kind"
105
105
106
106
# ginkgo test runner version to use. If the pre-installed version is
107
107
# different, the desired version is built from source.
@@ -379,8 +379,8 @@ install_kind () {
379
379
if run curl --fail --location -o " ${CSI_PROW_WORK} /bin/kind" " https://github.com/kubernetes-sigs/kind/releases/download/${CSI_PROW_KIND_VERSION} /kind-linux-amd64" ; then
380
380
chmod u+x " ${CSI_PROW_WORK} /bin/kind"
381
381
else
382
- git_checkout https://github.com/kubernetes-sigs/kind " $GOPATH /src/sigs.k8s.io/kind" " ${CSI_PROW_KIND_VERSION} " --depth=1 &&
383
- run_with_go " ${CSI_PROW_GO_VERSION_KIND} " go build -o " ${CSI_PROW_WORK} /bin/kind " sigs.k8s.io/kind
382
+ git_checkout https://github.com/kubernetes-sigs/kind " ${ GOPATH} /src/sigs.k8s.io/kind" " ${CSI_PROW_KIND_VERSION} " --depth=1 &&
383
+ (cd " ${GOPATH} /src/sigs.k8s.io/kind " && make install INSTALL_DIR= " ${CSI_PROW_WORK} /bin" )
384
384
fi
385
385
}
386
386
@@ -427,6 +427,27 @@ git_checkout () {
427
427
(cd " $path " && run git clean -fdx) || die " failed to clean $path "
428
428
}
429
429
430
+ # This clones a repo ("https://github.com/kubernetes/kubernetes")
431
+ # in a certain location ("$GOPATH/src/k8s.io/kubernetes") at
432
+ # a the head of a specific branch (i.e., release-1.13, master).
433
+ # The directory cannot exist.
434
+ git_clone_branch () {
435
+ local repo path branch parent
436
+ repo=" $1 "
437
+ shift
438
+ path=" $1 "
439
+ shift
440
+ branch=" $1 "
441
+ shift
442
+
443
+ parent=" $( dirname " $path " ) "
444
+ mkdir -p " $parent "
445
+ (cd " $parent " && run git clone --single-branch --branch " $branch " " $repo " " $path " ) || die " cloning $repo " failed
446
+ # This is useful for local testing or when switching between different revisions in the same
447
+ # repo.
448
+ (cd " $path " && run git clean -fdx) || die " failed to clean $path "
449
+ }
450
+
430
451
list_gates () (
431
452
set -f; IFS=' ,'
432
453
# Ignore: Double quote to prevent globbing and word splitting.
@@ -472,25 +493,10 @@ start_cluster () {
472
493
if [ " $version " = " latest" ]; then
473
494
version=master
474
495
fi
475
- git_checkout https://github.com/kubernetes/kubernetes " $GOPATH /src/k8s.io/kubernetes" " $version " --depth=1 || die " checking out Kubernetes $version failed"
476
-
477
- # "kind build" and/or the Kubernetes build rules need at least one tag, which we don't have
478
- # when doing a shallow fetch. Therefore we fake one:
479
- # release-1.12 -> v1.12.0-release.<rev>.csiprow
480
- # latest or <revision> -> v1.14.0-<rev>.csiprow
481
- case " ${CSI_PROW_KUBERNETES_VERSION} " in
482
- release-* )
483
- # Ignore: See if you can use ${variable//search/replace} instead.
484
- # shellcheck disable=SC2001
485
- tag=" $( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/release-\(.*\)/v\1.0-release./' ) " ;;
486
- * )
487
- # We have to make something up. v1.0.0 did not work for some reasons.
488
- tag=" v999.999.999-" ;;
489
- esac
490
- tag=" $tag $( cd " $GOPATH /src/k8s.io/kubernetes" && git rev-list --abbrev-commit HEAD) .csiprow"
491
- (cd " $GOPATH /src/k8s.io/kubernetes" && run git tag -f " $tag " ) || die " git tag failed"
492
- go_version=" $( go_version_for_kubernetes " $GOPATH /src/k8s.io/kubernetes" " $version " ) " || die " cannot proceed without knowing Go version for Kubernetes"
493
- run_with_go " $go_version " kind build node-image --type bazel --image csiprow/node:latest --kube-root " $GOPATH /src/k8s.io/kubernetes" || die " 'kind build node-image' failed"
496
+ git_clone_branch https://github.com/kubernetes/kubernetes " ${CSI_PROW_WORK} /src/kubernetes" " $version " || die " checking out Kubernetes $version failed"
497
+
498
+ go_version=" $( go_version_for_kubernetes " ${CSI_PROW_WORK} /src/kubernetes" " $version " ) " || die " cannot proceed without knowing Go version for Kubernetes"
499
+ run_with_go " $go_version " kind build node-image --type bazel --image csiprow/node:latest --kube-root " ${CSI_PROW_WORK} /src/kubernetes" || die " 'kind build node-image' failed"
494
500
csi_prow_kind_have_kubernetes=true
495
501
fi
496
502
image=" csiprow/node:latest"
0 commit comments