mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
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.
This commit is contained in:
parent
7b8bf758f3
commit
26439bb225
@ -32,11 +32,11 @@ function ensure-basic-networking() {
|
|||||||
echo 'Waiting for functional DNS (trying to resolve metadata.google.internal)...'
|
echo 'Waiting for functional DNS (trying to resolve metadata.google.internal)...'
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
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)...'
|
echo 'Waiting for functional DNS (trying to resolve my own FQDN)...'
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
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)...'
|
echo 'Waiting for functional DNS (trying to resolve my own IP)...'
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user