diff --git a/pkg/volume/cinder/cinder_test.go b/pkg/volume/cinder/cinder_test.go index 8fd2dfafe259..169933907d7a 100644 --- a/pkg/volume/cinder/cinder_test.go +++ b/pkg/volume/cinder/cinder_test.go @@ -123,7 +123,7 @@ func (fake *fakePDManager) DetachDisk(c *cinderVolumeUnmounter) error { func (fake *fakePDManager) CreateVolume(c *cinderVolumeProvisioner, node *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (volumeID string, volumeSizeGB int, labels map[string]string, fstype string, err error) { labels = make(map[string]string) - labels[v1.LabelFailureDomainBetaZone] = "nova" + labels[v1.LabelTopologyZone] = "nova" return "test-volume-name", 1, labels, "", nil } @@ -241,7 +241,7 @@ func TestPlugin(t *testing.T) { req := persistentSpec.Spec.NodeAffinity.Required.NodeSelectorTerms[0].MatchExpressions[0] - if req.Key != v1.LabelFailureDomainBetaZone { + if req.Key != v1.LabelTopologyZone { t.Errorf("Provision() returned unexpected requirement key in NodeAffinity %v", req.Key) } diff --git a/pkg/volume/cinder/cinder_util.go b/pkg/volume/cinder/cinder_util.go index ba75cb2573ac..734c6abe60c4 100644 --- a/pkg/volume/cinder/cinder_util.go +++ b/pkg/volume/cinder/cinder_util.go @@ -156,7 +156,7 @@ func getZonesFromNodes(kubeClient clientset.Interface) (sets.String, error) { return zones, err } for _, node := range nodes.Items { - if zone, ok := node.Labels[v1.LabelFailureDomainBetaZone]; ok { + if zone, ok := node.Labels[v1.LabelTopologyZone]; ok { zones.Insert(zone) } } @@ -229,10 +229,10 @@ func (util *DiskUtil) CreateVolume(c *cinderVolumeProvisioner, node *v1.Node, al volumeLabels = make(map[string]string) if IgnoreVolumeAZ == false { if volumeAZ != "" { - volumeLabels[v1.LabelFailureDomainBetaZone] = volumeAZ + volumeLabels[v1.LabelTopologyZone] = volumeAZ } if volumeRegion != "" { - volumeLabels[v1.LabelFailureDomainBetaRegion] = volumeRegion + volumeLabels[v1.LabelTopologyRegion] = volumeRegion } } return volumeID, volSizeGiB, volumeLabels, fstype, nil diff --git a/staging/src/k8s.io/legacy-cloud-providers/openstack/openstack_volumes.go b/staging/src/k8s.io/legacy-cloud-providers/openstack/openstack_volumes.go index 6c772a34bc99..92b9206326e1 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/openstack/openstack_volumes.go +++ b/staging/src/k8s.io/legacy-cloud-providers/openstack/openstack_volumes.go @@ -748,10 +748,10 @@ func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVo // Construct Volume Labels labels := make(map[string]string) if volume.AvailabilityZone != "" { - labels[v1.LabelFailureDomainBetaZone] = volume.AvailabilityZone + labels[v1.LabelTopologyZone] = volume.AvailabilityZone } if os.region != "" { - labels[v1.LabelFailureDomainBetaRegion] = os.region + labels[v1.LabelTopologyRegion] = os.region } klog.V(4).Infof("The Volume %s has labels %v", pv.Spec.Cinder.VolumeID, labels)