From 26439bb225845496e907a663a1074301fff9493f Mon Sep 17 00:00:00 2001 From: aalexand Date: Sat, 31 Oct 2015 16:53:57 -0700 Subject: [PATCH] Fix GCE DNS readiness polling. If the `hostname` commands used in the polling loop fail, their stdout is going to be empty and so `getent hosts` command will actually succeed. For the loop to work as expected, make sure the subcommands return a string which is an invalid host name. --- cluster/gce/configure-vm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index d7c9b0da67f..60ddec49570 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -32,11 +32,11 @@ function ensure-basic-networking() { echo 'Waiting for functional DNS (trying to resolve metadata.google.internal)...' sleep 3 done - until getent hosts $(hostname -f) &>/dev/null; do + until getent hosts $(hostname -f || echo _error_) &>/dev/null; do echo 'Waiting for functional DNS (trying to resolve my own FQDN)...' sleep 3 done - until getent hosts $(hostname -i) &>/dev/null; do + until getent hosts $(hostname -i || echo _error_) &>/dev/null; do echo 'Waiting for functional DNS (trying to resolve my own IP)...' sleep 3 done