Skip to content

Commit

Permalink
UPSTREAM: revert: 23578: get AZ of cinder volume from cinder and not …
Browse files Browse the repository at this point in the history
…from metadata
  • Loading branch information
gnufied committed Mar 23, 2021
1 parent a67f986 commit f2da1d9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,16 +739,16 @@ func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVo
return nil, nil
}

// Get metadata
md, err := getMetadata(os.metadataOpts.SearchOrder)
// Get Volume
volume, err := os.getVolume(pv.Spec.Cinder.VolumeID)
if err != nil {
return nil, err
}

// Construct Volume Labels
labels := make(map[string]string)
if md.AvailabilityZone != "" {
labels[v1.LabelFailureDomainBetaZone] = md.AvailabilityZone
if volume.AvailabilityZone != "" {
labels[v1.LabelFailureDomainBetaZone] = volume.AvailabilityZone
}
if os.region != "" {
labels[v1.LabelFailureDomainBetaRegion] = os.region
Expand Down

0 comments on commit f2da1d9

Please sign in to comment.