From 379e38b98ef9e45f0d9e908e2834f76300fcb635 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 2bacb9aa760..5c127f1e70c 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