mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Fix logic errors in validate cluster and make it work for vagrant again
This commit is contained in:
parent
8f5dd8cf63
commit
a6e87e786d
@ -61,3 +61,8 @@ function test-setup {
|
|||||||
function test-teardown {
|
function test-teardown {
|
||||||
echo "TODO"
|
echo "TODO"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set the {user} and {password} environment values required to interact with provider
|
||||||
|
function get-password {
|
||||||
|
echo "TODO"
|
||||||
|
}
|
||||||
|
@ -27,4 +27,5 @@ export KUBERNETES_MASTER="https://10.245.1.2"
|
|||||||
MINION_IP_BASE="10.245.2."
|
MINION_IP_BASE="10.245.2."
|
||||||
for (( i=0; i <${NUM_MINIONS}; i++)) do
|
for (( i=0; i <${NUM_MINIONS}; i++)) do
|
||||||
KUBE_MINION_IP_ADDRESSES[$i]="${MINION_IP_BASE}$[$i+2]"
|
KUBE_MINION_IP_ADDRESSES[$i]="${MINION_IP_BASE}$[$i+2]"
|
||||||
|
MINION_NAMES[$i]="${MINION_IP_BASE}$[$i+2]"
|
||||||
done
|
done
|
@ -67,3 +67,11 @@ function test-setup {
|
|||||||
function test-teardown {
|
function test-teardown {
|
||||||
echo "Vagrant ignores tear-down"
|
echo "Vagrant ignores tear-down"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set the {user} and {password} environment values required to interact with provider
|
||||||
|
function get-password {
|
||||||
|
export user=vagrant
|
||||||
|
export passwd=vagrant
|
||||||
|
echo "Using credentials: $user:$passwd"
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@ MINIONS_FILE=/tmp/minions
|
|||||||
$(dirname $0)/kubecfg.sh -template '{{range.Items}}{{.ID}}:{{end}}' list minions > ${MINIONS_FILE}
|
$(dirname $0)/kubecfg.sh -template '{{range.Items}}{{.ID}}:{{end}}' list minions > ${MINIONS_FILE}
|
||||||
|
|
||||||
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
||||||
count=$(grep -c ${MINION_NAMES[i]} ${MINIONS_FILE})
|
# Grep returns an exit status of 1 when line is not found, so we need the : to always return a 0 exit status
|
||||||
|
count=$(grep -c ${MINION_NAMES[i]} ${MINIONS_FILE}) || :
|
||||||
if [ "$count" == "0" ]; then
|
if [ "$count" == "0" ]; then
|
||||||
echo "Failed to find ${MINION_NAMES[i]}, cluster is probably broken."
|
echo "Failed to find ${MINION_NAMES[i]}, cluster is probably broken."
|
||||||
exit 1
|
exit 1
|
||||||
@ -47,7 +48,6 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
|||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Kubelet is successfully installed on ${MINION_NAMES[$i]}"
|
echo "Kubelet is successfully installed on ${MINION_NAMES[$i]}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Cluster validation succeeded"
|
echo "Cluster validation succeeded"
|
||||||
|
Loading…
Reference in New Issue
Block a user