Skip to content

Commit 057be1f

Browse files
authored
Merge pull request kubernetes#14477 from cofyc/kubetest-kind
kubetest: specify kind node image and update stable version
2 parents 5580315 + 067c67b commit 057be1f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

kubetest/kind/kind.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const (
4646
kindBinaryStable = "stable"
4747

4848
// If a new version of kind is released this value has to be updated.
49-
kindBinaryStableTag = "0.2.0"
49+
kindBinaryStableTag = "v0.5.1"
5050

5151
kindClusterNameDefault = "kind-kubetest"
5252

@@ -63,13 +63,14 @@ var (
6363
"or %q (download a stable binary).", kindBinaryBuild, kindBinaryStable))
6464
kindClusterName = flag.String("kind-cluster-name", kindClusterNameDefault,
6565
"(kind only) Name of the kind cluster.")
66+
kindNodeImage = flag.String("kind-node-image", "", "(kind only) name:tag of the node image to start the cluster. If build is enabled, this is ignored and built image is used.")
6667
)
6768

6869
var (
6970
kindBinaryStableHashes = map[string]string{
70-
"kind-linux-amd64": "7566c0117d824731be5caee10fef0a88fb65e3508ee22a305dc17507ee87d874",
71-
"kind-darwin-amd64": "ce85d3ed3d03702af0e9c617098249aff2e0811e1202036b260b23df4551f3ad",
72-
"kind-windows-amd64": "376862a3f6c449d91fccabfbae27a991e75177ad1111adbf2839a98f991eeef6",
71+
"kind-linux-amd64": "9a64f1774cdf24dad5f92e1299058b371c4e3f09d2f9eb281e91ed0777bd1e13",
72+
"kind-darwin-amd64": "b6a8fe2b3b53930a1afa4f91b033cdc24b0f6c628d993abaa9e40b57d261162a",
73+
"kind-windows-amd64": "df327d1e7f8bb41dfd5b1a69c5bc7a8d4bad95bb933562ca367a3a45b6c6ca04",
7374
}
7475
)
7576

@@ -133,7 +134,7 @@ func initializeDeployer(ctl *process.Control, buildType string) (*Deployer, erro
133134
kindBinaryDir: kindBinaryDir,
134135
kindBinaryPath: filepath.Join(kindBinaryDir, "kind"),
135136
kindBinaryVersion: *kindBinaryVersion,
136-
kindNodeImage: kindNodeImageLatest,
137+
kindNodeImage: *kindNodeImage,
137138
kindClusterName: *kindClusterName,
138139
}
139140
// Obtain the import paths for k8s and kind
@@ -239,23 +240,27 @@ func (d *Deployer) Build() error {
239240
log.Println("kind.go:Build()")
240241
// Adapt the build type if needed.
241242
var buildType string
243+
var buildNodeImage string
242244
switch d.buildType {
243245
case "":
244246
// The default option is to use a pre-build image.
245247
log.Println("Skipping the kind node image build.")
246-
d.kindNodeImage = ""
247248
return nil
248249
case "quick":
249250
// This is the default build type in kind.
250251
buildType = "docker"
252+
buildNodeImage = kindNodeImageLatest
251253
default:
252254
// Other types and 'bazel' are handled transparently here.
253255
buildType = d.buildType
256+
buildNodeImage = kindNodeImageLatest
254257
}
255258

256259
args := []string{"build", "node-image", "--type=" + buildType, flagLogLevel, "--kube-root=" + d.importPathK8s}
257-
if d.kindNodeImage != "" {
258-
args = append(args, "--image="+d.kindNodeImage)
260+
if buildNodeImage != "" {
261+
args = append(args, "--image="+buildNodeImage)
262+
// override user-specified node image
263+
d.kindNodeImage = buildNodeImage
259264
}
260265
if d.kindBaseImage != "" {
261266
args = append(args, "--base-image="+d.kindBaseImage)

0 commit comments

Comments
 (0)