Skip to content

Commit

Permalink
csi: add check for CSI PV
Browse files Browse the repository at this point in the history
There can be PV in the cluster which
are not CSI based and for those PV's
we need to check CSI in PV as its a
pointer object.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Jan 29, 2024
1 parent a519901 commit cab8bc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/filesystem/subvolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func getK8sRefSubvolume(ctx context.Context, clientsets *k8sutil.Clientsets) map
}
subvolumeNames := make(map[string]subVolumeInfo)
for _, pv := range pvList.Items {
if pv.Spec.CSI.VolumeAttributes["subvolumeName"] != "" {
if pv.Spec.CSI != nil && pv.Spec.CSI.VolumeAttributes["subvolumeName"] != "" {
subvolumeNames[pv.Spec.CSI.VolumeAttributes["subvolumeName"]] = subVolumeInfo{}
}
}
Expand Down

0 comments on commit cab8bc1

Please sign in to comment.