From cfbd54bebf743fa9579c063ccc2d69ccb1231869 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 2 Mar 2018 14:17:37 -0600 Subject: [PATCH] Add hacky-backslashy kubetest command --- prepare-vms/lib/commands.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/prepare-vms/lib/commands.sh b/prepare-vms/lib/commands.sh index 1503ec42..f9cc6671 100644 --- a/prepare-vms/lib/commands.sh +++ b/prepare-vms/lib/commands.sh @@ -171,6 +171,19 @@ _cmd_kube() { sep "Done" } +_cmd kubetest "Check that all notes are reporting as Ready" +_cmd_kubetest() { + # There are way too many backslashes in the command below. + # Feel free to make that better ♥ + pssh -i " + set -e + if grep -q node1 /tmp/node; then + for NODE in \$(awk /\ node/\ {print\ \\\$2} /etc/hosts); do + echo \$NODE ; kubectl get nodes | grep -w \$NODE | grep -w Ready + done + fi" +} + _cmd ids "List the instance IDs belonging to a given tag or token" _cmd_ids() { TAG=$1