Skip to content

Commit cb94781

Browse files
committed
Add verbosity to cluster-wait script
1 parent 849d53a commit cb94781

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

hack/cluster-wait

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33
CLUSTER_NAME=${CLUSTER_NAME:?CLUSTER_NAME is required}
44
KEIGHTS=${KEIGHTS:?KEIGHTS is required}
55
TIMEOUT_SECONDS=${TIMEOUT_SECONDS:-900}
6-
INTERVAL_SECONDS=${INTERVAL_SECONDS:-10}
6+
INTERVAL_SECONDS=${INTERVAL_SECONDS:-5}
7+
QUIET=${QUIET:-false}
78

89
kubectl() {
9-
${KEIGHTS} kubectl --cluster-name ${CLUSTER_NAME} -- "${@}"
10+
if [ "${QUIET}" = "true" ]; then
11+
${KEIGHTS} kubectl --cluster-name ${CLUSTER_NAME} -- "${@}" >/dev/null 2>&1
12+
else
13+
${KEIGHTS} kubectl --cluster-name ${CLUSTER_NAME} -- "${@}"
14+
fi
1015
}
1116

1217
now=$(date +%s)
1318
deadline=$((${now} + ${TIMEOUT_SECONDS}))
1419

1520
echo "Waiting for API server..."
1621
while true; do
17-
if kubectl get --raw /readyz >/dev/null 2>&1; then
22+
if kubectl get --raw /readyz; then
1823
break
1924
fi
2025
now=$(date +%s)
@@ -27,7 +32,7 @@ done
2732

2833
echo "Waiting for nodes to be Ready..."
2934
while true; do
30-
if kubectl wait --for=condition=Ready nodes --all --timeout=1s >/dev/null 2>&1; then
35+
if kubectl wait --for=condition=Ready nodes --all --timeout=1s; then
3136
break
3237
fi
3338
now=$(date +%s)

0 commit comments

Comments
 (0)