From a7084079656d27fc06cb613d1bbd4ccc3057c369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 13 Apr 2015 15:13:53 +0200 Subject: [PATCH] libvirt-coreos cluster: fix wait-cluster-readiness for v1beta3 API Fix the kubectl query to use to check the nodes readiness. --- cluster/libvirt-coreos/util.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/libvirt-coreos/util.sh b/cluster/libvirt-coreos/util.sh index e93798594a8..29ce99751f9 100644 --- a/cluster/libvirt-coreos/util.sh +++ b/cluster/libvirt-coreos/util.sh @@ -112,7 +112,7 @@ function initialize-pool { fi wget -N -P "$ROOT" http://${COREOS_CHANNEL:-alpha}.release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2 - if [ "$ROOT/coreos_production_qemu_image.img.bz2" -nt "$POOL_PATH/coreos_base.img" ]; then + if [[ "$ROOT/coreos_production_qemu_image.img.bz2" -nt "$POOL_PATH/coreos_base.img" ]]; then bunzip2 -f -k "$ROOT/coreos_production_qemu_image.img.bz2" virsh vol-delete coreos_base.img --pool $POOL 2> /dev/null || true mv "$ROOT/coreos_production_qemu_image.img" "$POOL_PATH/coreos_base.img" @@ -163,9 +163,9 @@ function wait-cluster-readiness { echo "Wait for cluster readiness" local kubectl="${KUBE_ROOT}/cluster/kubectl.sh" - local timeout=50 + local timeout=120 while [[ $timeout -ne 0 ]]; do - nb_ready_minions=$("${kubectl}" get nodes -o template -t "{{range.items}}{{range.status.conditions}}{{.kind}}{{end}}:{{end}}" --api-version=v1beta3 2>/dev/null | tr ':' '\n' | grep -c Ready || true) + nb_ready_minions=$("${kubectl}" get nodes -o template -t "{{range.items}}{{range.status.conditions}}{{.type}}{{end}}:{{end}}" --api-version=v1beta3 2>/dev/null | tr ':' '\n' | grep -c Ready || true) echo "Nb ready minions: $nb_ready_minions / $NUM_MINIONS" if [[ "$nb_ready_minions" -eq "$NUM_MINIONS" ]]; then return 0