mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-10 10:05:34 +00:00
If dig fails to reach the DNS, it will output errors to stdout, which can cause the test -n to falsely pass: ubuntu@ubuntu:~$ dig +notcp +noall +answer +search kubernetes.default A ;; connection timed out; no servers could be reached command terminated with exit code 9 ubuntu@ubuntu:~$ test -n "$(dig +notcp +noall +answer +search kubernetes.default A)" && echo OK OK This patch solves this issue by making sure the dig command actually succeeds before checking its output.