Skip to content

Commit 610a7ce

Browse files
committed
Improve k8s_setup.sh debugging
* Don't hide kubectl stderr. * Print output of kubectl node status. * Use `/usr/bin/env` to access bash for improved platform comaptibility. Signed-off-by: SuperQ <superq@gmail.com>
1 parent c05e817 commit 610a7ce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build/kubernetes/k8s_setup.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -v
33

44
# Install kubectl
@@ -11,9 +11,12 @@ curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND
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;
14+
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
15+
out=''
16+
until [[ "${out}" =~ 'Ready=True' ]]; do
17+
sleep 1
18+
out=$(kubectl get nodes -o jsonpath="$JSONPATH")
19+
echo "${out}"
1720
done
1821

1922
# Scale the CoreDNS replicas to simplify testing

0 commit comments

Comments
 (0)