mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Merge pull request #27896 from mml/fed-labels-not-annotations
Automatic merge from submit-queue Look for the failure zone label in labels.
This commit is contained in:
commit
e70434a19f
@ -648,7 +648,7 @@ func (kd *KubeDNS) getClusterZone() (string, error) {
|
|||||||
|
|
||||||
// Select a node (arbitrarily the first node) that has `LabelZoneFailureDomain` set.
|
// Select a node (arbitrarily the first node) that has `LabelZoneFailureDomain` set.
|
||||||
for _, nodeItem := range nodeList.Items {
|
for _, nodeItem := range nodeList.Items {
|
||||||
if _, ok := nodeItem.Annotations[unversioned.LabelZoneFailureDomain]; !ok {
|
if _, ok := nodeItem.Labels[unversioned.LabelZoneFailureDomain]; !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Make a copy of the node, don't rely on the loop variable.
|
// 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")
|
return "", fmt.Errorf("Could not find any nodes")
|
||||||
}
|
}
|
||||||
|
|
||||||
zone, ok := node.Annotations[unversioned.LabelZoneFailureDomain]
|
zone, ok := node.Labels[unversioned.LabelZoneFailureDomain]
|
||||||
if !ok || zone == "" {
|
if !ok || zone == "" {
|
||||||
return "", fmt.Errorf("unknown cluster zone")
|
return "", fmt.Errorf("unknown cluster zone")
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ func newNodes() *kapi.NodeList {
|
|||||||
{
|
{
|
||||||
ObjectMeta: kapi.ObjectMeta{
|
ObjectMeta: kapi.ObjectMeta{
|
||||||
Name: "testnode-1",
|
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
|
// 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
|
// format used by the cloud providers to name their zones. But that shouldn't matter
|
||||||
// for these tests here.
|
// for these tests here.
|
||||||
|
Loading…
Reference in New Issue
Block a user