]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: fixing rook-ceph-exporter daemon type handling
authorRedouane Kachach <rkachach@redhat.com>
Tue, 10 Oct 2023 09:54:44 +0000 (11:54 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Tue, 10 Oct 2023 10:39:16 +0000 (12:39 +0200)
Fixes: https://tracker.ceph.com/issues/63107
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/rook/module.py

index b67349d1bff6229ba3f76f7b4cd896475c4d1622..32699fa0117a79886a268ac12476f04b7fda6226 100644 (file)
@@ -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,