Skip to content

Commit baaf458

Browse files
authored
Merge pull request #168 from polarathene/patch-2
chore: `k8s_setup.sh` should use `kubectl wait`
2 parents efbef7b + ef2b986 commit baaf458

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

build/kubernetes/k8s_setup.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIN
1111
kind create cluster --image "kindest/node:${K8S_VERSION}"
1212

1313
# Wait for cluster to be ready
14-
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
15-
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
16-
sleep 1;
17-
done
14+
kubectl wait --for=condition=Ready nodes --all --timeout=60s >/dev/null 2>&1
1815

1916
# Scale the CoreDNS replicas to simplify testing
2017
kubectl scale -n kube-system deployment/coredns --replicas=1

0 commit comments

Comments
 (0)