fix aws provider to handle only EBS volumes
When the cloud-controller-manager is running with PV label initializing controller and NFS volume is created, it causes nill reference error. fixes #68996
This commit is contained in:
@@ -2323,6 +2323,11 @@ func (c *Cloud) checkIfAvailable(disk *awsDisk, opName string, instance string)
|
||||
|
||||
// GetLabelsForVolume gets the volume labels for a volume
|
||||
func (c *Cloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error) {
|
||||
// Ignore if not AWSElasticBlockStore.
|
||||
if pv.Spec.AWSElasticBlockStore == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Ignore any volumes that are being provisioned
|
||||
if pv.Spec.AWSElasticBlockStore.VolumeID == volume.ProvisionedVolumeName {
|
||||
return nil, nil
|
||||
|
Reference in New Issue
Block a user