Skip to content

Commit 140ceeb

Browse files
Merge pull request #1828 from zkyle95/master
Specify cluster name when there is only one cluster in kind
2 parents b39d17f + d6b1089 commit 140ceeb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/build_local.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ docker build -f e2e.Dockerfile -t quay.io/operator-framework/olm:local -t quay.i
1717
docker build -f test/e2e/hang.Dockerfile -t hang:10 ./bin
1818

1919
if [ -n "$KIND" ]; then
20-
kind load docker-image quay.io/operator-framework/olm:local
21-
kind load docker-image quay.io/operator-framework/olm-e2e:local
22-
kind load docker-image hang:10
20+
CLUSTERS=($(kind get clusters))
21+
22+
# kind will use the cluster named kind by default, so if there is only one cluster, specify it
23+
if [[ ${#CLUSTERS[@]} == 1 ]]; then
24+
KIND_FLAGS="--name ${CLUSTERS[0]}"
25+
echo 'Use cluster ${CLUSTERS[0]}'
26+
fi
27+
28+
kind load docker-image quay.io/operator-framework/olm:local ${KIND_FLAGS}
29+
kind load docker-image quay.io/operator-framework/olm-e2e:local ${KIND_FLAGS}
30+
kind load docker-image hang:10 ${KIND_FLAGS}
2331
fi

0 commit comments

Comments
 (0)