Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look for the failure zone label in labels. #27896

Merged
merged 1 commit into from
Jun 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dns/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down