mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
explicitly check "Ready" condition in validate-cluster
This commit is contained in:
parent
3dc7c64ce9
commit
5c72696aad
@ -40,7 +40,7 @@ while true; do
|
||||
# Suppress errors from kubectl output because during cluster bootstrapping
|
||||
# for clusters where the master node is registered, the apiserver will become
|
||||
# available and then get restarted as the kubelet configures the docker bridge.
|
||||
nodes_status=$("${KUBE_ROOT}/cluster/kubectl.sh" get nodes -o template --template='{{range .items}}{{with index .status.conditions 0}}{{.type}}:{{.status}},{{end}}{{end}}' --api-version=v1) || true
|
||||
nodes_status=$("${KUBE_ROOT}/cluster/kubectl.sh" get nodes -o template --template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}}{{.type}}:{{.status}},{{end}}{{end}}{{end}}' --api-version=v1) || true
|
||||
found=$(echo "${nodes_status}" | tr "," "\n" | grep -c 'Ready:') || true
|
||||
ready=$(echo "${nodes_status}" | tr "," "\n" | grep -c 'Ready:True') || true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user