Commit 3b0ddbf0 authored by Martin Vladev's avatar Martin Vladev

fix openstack provider to handle only Cinder volumes

When the cloud-controller-manager is running with PV label initializing controller and NFS volume is created, it causes nill reference error. related to #68996
parent 59625d87
......@@ -697,6 +697,11 @@ func (os *OpenStack) ShouldTrustDevicePath() bool {
// GetLabelsForVolume implements PVLabeler.GetLabelsForVolume
func (os *OpenStack) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error) {
// Ignore if not Cinder.
if pv.Spec.Cinder == nil {
return nil, nil
}
// Ignore any volumes that are being provisioned
if pv.Spec.Cinder.VolumeID == k8s_volume.ProvisionedVolumeName {
return nil, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment