From 90ae55f6d1ecc9c951e5dfa7d5a5d2169d3a917f Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Tue, 10 Oct 2023 11:54:44 +0200 Subject: [PATCH] mgr/rook: fixing rook-ceph-exporter daemon type handling Fixes: https://tracker.ceph.com/issues/63107 Signed-off-by: Redouane Kachach --- src/pybind/mgr/rook/module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index b67349d1bff62..32699fa0117a7 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -457,7 +457,17 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): for p in pods: sd = orchestrator.DaemonDescription() sd.hostname = p['hostname'] - sd.daemon_type = p['labels']['app'].replace('rook-ceph-', '') + + # In Rook environments, the 'ceph-exporter' daemon is named 'exporter' whereas + # in the orchestrator interface, it is named 'ceph-exporter'. The purpose of the + # following adjustment is to ensure that the 'daemon_type' is correctly set. + # Without this adjustment, the 'service_to_daemon_types' lookup would fail, as + # it would be searching for a non-existent entry called 'exporter + if p['labels']['app'] == 'rook-ceph-exporter': + sd.daemon_type = 'ceph-exporter' + else: + sd.daemon_type = p['labels']['app'].replace('rook-ceph-', '') + status = { 'Pending': orchestrator.DaemonDescriptionStatus.starting, 'Running': orchestrator.DaemonDescriptionStatus.running, -- 2.39.5