mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix validate-cluster.sh to work on Mac.
This commit is contained in:
parent
7d3c15dd4d
commit
acb64e66e8
@ -59,10 +59,9 @@ while true; do
|
|||||||
# Parse the output to capture the value of the second column("HEALTH"), then use grep to
|
# Parse the output to capture the value of the second column("HEALTH"), then use grep to
|
||||||
# count the number of times it doesn't match "success".
|
# count the number of times it doesn't match "success".
|
||||||
# Because of the header, the actual unsuccessful count is 1 minus the count.
|
# Because of the header, the actual unsuccessful count is 1 minus the count.
|
||||||
|
|
||||||
non_success_count=$(echo "${kubectl_output}" | \
|
non_success_count=$(echo "${kubectl_output}" | \
|
||||||
sed -n 's/^\([[:alnum:][:punct:]]\+\)\s\+\([[:alnum:][:punct:]]\+\)\s\+.*/\2/p' | \
|
sed -n 's/^[[:alnum:][:punct:]]/&/p' | \
|
||||||
grep 'Healthy' --invert-match -c)
|
grep --invert-match -c '^[[:alnum:][:punct:]]\{1,\}[[:space:]]\{1,\}Healthy')
|
||||||
|
|
||||||
if ((non_success_count > 1)); then
|
if ((non_success_count > 1)); then
|
||||||
if ((attempt < 5)); then
|
if ((attempt < 5)); then
|
||||||
|
Loading…
Reference in New Issue
Block a user