From 48bd10be142cdc2d081235a0b99542c27632ab18 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 27 Aug 2024 11:09:51 +0200 Subject: [PATCH] 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 --- internal/rbd/rbd_healer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/rbd/rbd_healer.go b/internal/rbd/rbd_healer.go index 2bacb9aa760f..5c127f1e70ca 100644 --- a/internal/rbd/rbd_healer.go +++ b/internal/rbd/rbd_healer.go @@ -196,6 +196,10 @@ func RunVolumeHealer(ns *NodeServer, conf *util.Config) error { if pv.Status.Phase != v1.VolumeBound || pv.DeletionTimestamp != nil { continue } + + if pv.Spec.PersistentVolumeSource.CSI == nil { + continue + } // skip if mounter is not rbd-nbd if pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes["mounter"] != "rbd-nbd" { continue