rbd: add a check for CSI pv

add a check for CSI as it can be
nil for non-csi PV.

fixes: #4807

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-08-27 11:09:51 +02:00 committed by mergify[bot]
parent 4f357b7e27
commit 3ac596840c

View File

@ -196,6 +196,10 @@ func RunVolumeHealer(ns *NodeServer, conf *util.Config) error {
if pv.Status.Phase != v1.VolumeBound || pv.DeletionTimestamp != nil { if pv.Status.Phase != v1.VolumeBound || pv.DeletionTimestamp != nil {
continue continue
} }
if pv.Spec.PersistentVolumeSource.CSI == nil {
continue
}
// skip if mounter is not rbd-nbd // skip if mounter is not rbd-nbd
if pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes["mounter"] != "rbd-nbd" { if pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes["mounter"] != "rbd-nbd" {
continue continue