Skip to content

Commit ea5bea2

Browse files
committed
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.
1 parent 4e8a7f4 commit ea5bea2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

staging/src/k8s.io/legacy-cloud-providers/openstack/openstack_volumes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,11 @@ func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVo
726726
return nil, nil
727727
}
728728

729+
// if volume az is to be ignored we should return nil from here
730+
if os.bsOpts.IgnoreVolumeAZ {
731+
return nil, nil
732+
}
733+
729734
// Get Volume
730735
volume, err := os.getVolume(pv.Spec.Cinder.VolumeID)
731736
if err != nil {

0 commit comments

Comments
 (0)