Respect ignore-volume-az option in admission plugin

We appear to be respecting this options when provisioning the volume
but when PV is admitted the zone/region fields get added back to the
PV and hence defeating the purpose of the option.
This commit is contained in:
Hemant Kumar 2020-02-21 22:12:58 -05:00
parent 4e8a7f4a4b
commit ea5bea2b9f

View File

@ -726,6 +726,11 @@ func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVo
return nil, nil
}
// if volume az is to be ignored we should return nil from here
if os.bsOpts.IgnoreVolumeAZ {
return nil, nil
}
// Get Volume
volume, err := os.getVolume(pv.Spec.Cinder.VolumeID)
if err != nil {