From 508658f7971827d39ae58df6c16a3bbc9ae528a4 Mon Sep 17 00:00:00 2001 From: Santosh Pillai Date: Mon, 15 Sep 2025 17:10:12 +0530 Subject: [PATCH] mon: fix mon health nil pointer exception shouldFailoverMonImmediately has a nil pointer exception with mons on PVC. Rook-ceph-mon-endpoint does not store node information of the mons on PVC. So `mapping.Hostname` throws nill pointer Signed-off-by: Santosh Pillai (cherry picked from commit d399615bdc6fadcd191feff3a5ec10fb9c31ecca) --- pkg/operator/ceph/cluster/mon/health.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/operator/ceph/cluster/mon/health.go b/pkg/operator/ceph/cluster/mon/health.go index 7b3216bb9..190cccdb5 100644 --- a/pkg/operator/ceph/cluster/mon/health.go +++ b/pkg/operator/ceph/cluster/mon/health.go @@ -394,6 +394,11 @@ func (c *Cluster) shouldFailoverMonImmediately(ctx context.Context, monName stri logger.Debugf("checking if mon %q is scheduled on a node", monName) assignedNode := "" if mapping, ok := c.mapping.Schedule[monName]; ok { + if mapping == nil { + // mon schedule information is not available in the rook-ceph-mon-endpoints configmap in case of mons on PVC + logger.Debugf("mon schedule information is not available for mon %q", monName) + return false + } assignedNode = mapping.Hostname } if assignedNode == "" {