From a827ef0713078cd3b1fca637f12f8afb631c9438 Mon Sep 17 00:00:00 2001 From: "Madhusudan.C.S" Date: Thu, 23 Jun 2016 12:33:41 -0700 Subject: [PATCH] Addressed review comments. --- pkg/dns/dns.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index 236094087f7..10aa0363ac4 100644 --- a/pkg/dns/dns.go +++ b/pkg/dns/dns.go @@ -649,7 +649,8 @@ func (kd *KubeDNS) getClusterZoneAndRegion() (string, string, error) { return "", "", fmt.Errorf("failed to retrieve the cluster nodes: %v", err) } - // Select a node (arbitrarily the first node) that has `LabelZoneFailureDomain` set. + // Select a node (arbitrarily the first node) that has + // `LabelZoneFailureDomain` and `LabelZoneRegion` set. for _, nodeItem := range nodeList.Items { _, zfound := nodeItem.Labels[unversioned.LabelZoneFailureDomain] _, rfound := nodeItem.Labels[unversioned.LabelZoneRegion] @@ -661,6 +662,8 @@ func (kd *KubeDNS) getClusterZoneAndRegion() (string, string, error) { if err := kd.nodesStore.Add(node); err != nil { return "", "", fmt.Errorf("couldn't add the retrieved node to the cache: %v", err) } + // Node is found, break out of the loop. + break } }