Skip to content

Commit 160a241

Browse files
committed
install kind for integration tests
this is pretty cheap/fast, kind is a very small go binary, and upgrades can now be tested with PRs to this repo
1 parent 8f1101b commit 160a241

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

hack/tools/ensure-kind.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# usage: source this script to ensure kind is setup
17+
18+
# ensure kind is available for setup-kind-cluster.sh etc
19+
# TODO: consider factoring out the kind version used for CI or
20+
# else ensure all CI jobs use this script
21+
# TODO: consider enforcing a particular version locally as well to avoid confusion
22+
if ! command -v kind; then
23+
local repo_gobin="${REPO_ROOT}/_bin"
24+
GOBIN="${repo_gobin}" go install sigs.k8s.io/[email protected]
25+
export PATH="${repo_gobin}:${PATH}"
26+
fi

test/integration/integration-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ function main() {
219219
done
220220

221221
if ((setup_kind_cluster)); then
222+
source "${REPO_ROOT}"/hack/tools/ensure-kind.sh
222223
"${SCRIPT_ROOT}"/setup-kind-cluster.sh \
223224
-fakepubsub-node-port="${fakepubsub_node_port}"
224225
fi

0 commit comments

Comments
 (0)