Skip to content

Commit

Permalink
Merge pull request kubernetes#342 from mvladev/fix-GetLabelsForVolume…
Browse files Browse the repository at this point in the history
…-nil-dereference

fix GetLabelsForVolume to handle only Cinder volumes
  • Loading branch information
k8s-ci-robot authored Nov 11, 2018
2 parents a6057f2 + f06c429 commit 1f196f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cloudprovider/providers/openstack/openstack_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,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
Expand Down

0 comments on commit 1f196f9

Please sign in to comment.