Skip to content

Commit

Permalink
rbd: add a check for CSI pv
Browse files Browse the repository at this point in the history
add a check for CSI as it can be
nil for non-csi PV.

fixes: #4807

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Aug 27, 2024
1 parent 4f357b7 commit 379e38b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/rbd/rbd_healer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 379e38b

Please sign in to comment.