mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
Merge pull request #44600 from phlogistonjohn/jjm-mirror-service-module
mgr/cephadm: auto-enable mirroring module when deploying service Reviewed-by: Michael Fritch <mfritch@suse.com>
This commit is contained in:
commit
2c17af2eb5
@ -986,6 +986,18 @@ class CrashService(CephService):
|
||||
class CephfsMirrorService(CephService):
|
||||
TYPE = 'cephfs-mirror'
|
||||
|
||||
def config(self, spec: ServiceSpec) -> None:
|
||||
# make sure mirroring module is enabled
|
||||
mgr_map = self.mgr.get('mgr_map')
|
||||
mod_name = 'mirroring'
|
||||
if mod_name not in mgr_map.get('services', {}):
|
||||
self.mgr.check_mon_command({
|
||||
'prefix': 'mgr module enable',
|
||||
'module': mod_name
|
||||
})
|
||||
# we shouldn't get here (mon will tell the mgr to respawn), but no
|
||||
# harm done if we do.
|
||||
|
||||
def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonDeploySpec:
|
||||
assert self.TYPE == daemon_spec.daemon_type
|
||||
|
||||
|
@ -777,3 +777,15 @@ class TestIngressService:
|
||||
}
|
||||
|
||||
assert haproxy_generated_conf[0] == haproxy_expected_conf
|
||||
|
||||
|
||||
class TestCephFsMirror:
|
||||
@patch("cephadm.serve.CephadmServe._run_cephadm")
|
||||
def test_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
|
||||
_run_cephadm.side_effect = async_side_effect(('{}', '', 0))
|
||||
with with_host(cephadm_module, 'test'):
|
||||
with with_service(cephadm_module, ServiceSpec('cephfs-mirror')):
|
||||
cephadm_module.assert_issued_mon_command({
|
||||
'prefix': 'mgr module enable',
|
||||
'module': 'mirroring'
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user