From 942d4dedc133164a18b1d5488dae29b70982df7d Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 31 Oct 2018 07:40:29 -0400 Subject: [PATCH] orchestrator/rook: allow describe_service to report mgr containers This label seems to be present in the rook version I've been working with, so let's wire it in. Signed-off-by: Jeff Layton --- doc/mgr/orchestrator_cli.rst | 2 +- src/pybind/mgr/rook/module.py | 6 ++---- src/pybind/mgr/rook/rook_cluster.py | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/mgr/orchestrator_cli.rst b/doc/mgr/orchestrator_cli.rst index 67ff0726991..cbd2b317525 100644 --- a/doc/mgr/orchestrator_cli.rst +++ b/doc/mgr/orchestrator_cli.rst @@ -43,7 +43,7 @@ filtered to a particular node: orchestrator device ls [node] -Query the status of a particular service (mon, osd, mds, rgw). For OSDs +Query the status of a particular service (mon, osd, mgr, mds, rgw). For OSDs the id is the numeric OSD ID, for MDS services it is the filesystem name: :: diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index bbc0ceebb7a..1853606a752 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -334,7 +334,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): @deferred_read def describe_service(self, service_type, service_id): - assert service_type in ("mds", "osd", "mon", "rgw"), service_type + " unsupported" + assert service_type in ("mds", "osd", "mgr", "mon", "rgw"), service_type + " unsupported" pods = self.rook_cluster.describe_pods(service_type, service_id) @@ -354,9 +354,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): elif service_type == "mon": sl.daemon_name = p['labels']["mon"] elif service_type == "mgr": - # FIXME: put a label on the pod to consume - # from here - raise NotImplementedError("mgr") + sl.daemon_name = p['labels']["mgr"] elif service_type == "rgw": # FIXME: put a label on the pod to consume # from here diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index e3303408e60..ff2b90ceb18 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -154,8 +154,7 @@ class RookCluster(object): # label like mon=rook-ceph-mon0 label_filter += ",mon={0}".format(service_id) elif service_type == "mgr": - # TODO: get Rook to label mgr pods - pass + label_filter += ",mgr={0}".format(service_id) elif service_type == "rgw": # TODO: rgw pass -- 2.39.5