Skip to content

Commit 8255374

Browse files
Merge pull request #1324 from benluddy/local-kind-detection
Fix kind detection for local builds.
2 parents 976cbe8 + b6958b3 commit 8255374

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

scripts/build_local.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55

66
set -e
77

8-
if [ -z "$NO_MINIKUBE" ]; then
9-
pgrep -f "[m]inikube" >/dev/null || minikube start --kubernetes-version="v1.16.2" --extra-config=apiserver.v=4 || { echo 'Cannot start minikube.'; exit 1; }
10-
eval "$(minikube docker-env)" || { echo 'Cannot switch to minikube docker'; exit 1; }
11-
kubectl config use-context minikube
12-
fi
13-
148
docker build -f local.Dockerfile -t quay.io/operator-framework/olm:local -t quay.io/operator-framework/olm-e2e:local ./bin
159
docker build -f test/e2e/hang.Dockerfile -t hang:10 ./bin
1610

17-
if [ -x "$(command -v kind)" ] && [ "$(kubectl config current-context)" = "kind" ]; then
11+
if [ -x "$(command -v kind)" ] && [[ "$(kubectl config current-context)" =~ ^kind-? ]]; then
1812
kind load docker-image quay.io/operator-framework/olm:local
1913
kind load docker-image quay.io/operator-framework/olm-e2e:local
14+
kind load docker-image hang:10
15+
exit 0 # don't bother with minikube if kind is active
16+
fi
17+
18+
if [ -z "$NO_MINIKUBE" ]; then
19+
pgrep -f "[m]inikube" >/dev/null || minikube start --kubernetes-version="v1.16.2" --extra-config=apiserver.v=4 || { echo 'Cannot start minikube.'; exit 1; }
20+
eval "$(minikube docker-env)" || { echo 'Cannot switch to minikube docker'; exit 1; }
21+
kubectl config use-context minikube
2022
fi

0 commit comments

Comments
 (0)