From 799acf2d98883eb565f6ac4733223944d8fb4c48 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 (cherry picked from commit 3ac596840ca581a6a5b5166707c561d10432fc50) --- 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 2bacb9aa7..5c127f1e7 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