Add nil check in GetPodVolumes portworx implementation.
A PVC object can be empty if the PersistentVolume is directly
provided in the pod spec.
@@ -759,9 +759,13 @@ func (p *portworx) GetPodVolumes(podSpec *v1.PodSpec, namespace string) ([]*stor
if len(volumeInfo.Labels) == 0 {
volumeInfo.Labels = make(map[string]string)
}
+
+ if pvc != nil {
for k, v := range pvc.ObjectMeta.Annotations {
volumeInfo.Labels[k] = v
}
+ }
+
volumes = append(volumes, volumeInfo)
}
}
