mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Don't add empty AZ labels to OpenStack volumes
This commit is contained in:
parent
604569482f
commit
e9ca265901
@ -744,8 +744,12 @@ func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVo
|
|||||||
|
|
||||||
// Construct Volume Labels
|
// Construct Volume Labels
|
||||||
labels := make(map[string]string)
|
labels := make(map[string]string)
|
||||||
labels[v1.LabelZoneFailureDomain] = volume.AvailabilityZone
|
if volume.AvailabilityZone != "" {
|
||||||
labels[v1.LabelZoneRegion] = os.region
|
labels[v1.LabelZoneFailureDomain] = volume.AvailabilityZone
|
||||||
|
}
|
||||||
|
if os.region != "" {
|
||||||
|
labels[v1.LabelZoneRegion] = os.region
|
||||||
|
}
|
||||||
klog.V(4).Infof("The Volume %s has labels %v", pv.Spec.Cinder.VolumeID, labels)
|
klog.V(4).Infof("The Volume %s has labels %v", pv.Spec.Cinder.VolumeID, labels)
|
||||||
|
|
||||||
return labels, nil
|
return labels, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user