Merge pull request #57337 from wwwtyro/rye/wait-kube-dns

Automatic merge from submit-queue (batch tested with PRs 55751, 57337, 56406, 56864, 57347). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Wait for kubedns to be ready when collecting the cluster IP.

**What this PR does / why we need it**: Wait for kubedns to be ready when collecting the cluster IP.

**Release note**:
```release-note
Wait for kubedns to be ready when collecting the cluster IP.
```
This commit is contained in:
Kubernetes Submit Queue 2017-12-18 18:50:40 -08:00 committed by GitHub
commit 4c36d487f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -469,7 +469,13 @@ def send_cluster_dns_detail(kube_control):
''' Send cluster DNS info '''
enableKubeDNS = hookenv.config('enable-kube-dns')
dnsDomain = hookenv.config('dns_domain')
dns_ip = None if not enableKubeDNS else get_dns_ip()
dns_ip = None
if enableKubeDNS:
try:
dns_ip = get_dns_ip()
except CalledProcessError:
hookenv.log("kubedns not ready yet")
return
kube_control.set_dns(53, dnsDomain, dns_ip, enableKubeDNS)