From c87b61341241bae37017db5f76902ea2642ea169 Mon Sep 17 00:00:00 2001 From: Matt Liggett Date: Wed, 22 Jun 2016 13:26:58 -0700 Subject: [PATCH] Look for the failure zone label in labels. Not annotations. Found this working on #27819. --- pkg/dns/dns.go | 4 ++-- pkg/dns/dns_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index b65fe9fc55e..9e5c98d8758 100644 --- a/pkg/dns/dns.go +++ b/pkg/dns/dns.go @@ -648,7 +648,7 @@ func (kd *KubeDNS) getClusterZone() (string, error) { // Select a node (arbitrarily the first node) that has `LabelZoneFailureDomain` set. for _, nodeItem := range nodeList.Items { - if _, ok := nodeItem.Annotations[unversioned.LabelZoneFailureDomain]; !ok { + if _, ok := nodeItem.Labels[unversioned.LabelZoneFailureDomain]; !ok { continue } // Make a copy of the node, don't rely on the loop variable. @@ -663,7 +663,7 @@ func (kd *KubeDNS) getClusterZone() (string, error) { return "", fmt.Errorf("Could not find any nodes") } - zone, ok := node.Annotations[unversioned.LabelZoneFailureDomain] + zone, ok := node.Labels[unversioned.LabelZoneFailureDomain] if !ok || zone == "" { return "", fmt.Errorf("unknown cluster zone") } diff --git a/pkg/dns/dns_test.go b/pkg/dns/dns_test.go index 061accf2f3d..3ea240c24cb 100644 --- a/pkg/dns/dns_test.go +++ b/pkg/dns/dns_test.go @@ -433,7 +433,7 @@ func newNodes() *kapi.NodeList { { ObjectMeta: kapi.ObjectMeta{ Name: "testnode-1", - Annotations: map[string]string{ + Labels: map[string]string{ // Note: The zone name here is an arbitrary string and doesn't exactly follow the // format used by the cloud providers to name their zones. But that shouldn't matter // for these tests here.