Skip to content

Commit faa2daf

Browse files
committed
mgr/cephadm: redeploy when some dependency daemon is add/removed
previous code was failing to redeploy in some scenarios when daemons are removed. The new check takes into account both when services are add or removed plus changes on the secure_monitoring_stack value. Signed-off-by: Redouane Kachach <[email protected]>
1 parent c80f7fd commit faa2daf

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/pybind/mgr/cephadm/serve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def _check_daemons(self) -> None:
10931093
action = 'reconfig'
10941094
# we need only redeploy if secure_monitoring_stack value has changed:
10951095
if dd.daemon_type in ['prometheus', 'node-exporter', 'alertmanager']:
1096-
diff = list(set(last_deps) - set(deps))
1096+
diff = list(set(last_deps).symmetric_difference(set(deps)))
10971097
if any('secure_monitoring_stack' in e for e in diff):
10981098
action = 'redeploy'
10991099
elif dd.daemon_type == 'jaeger-agent':

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,6 @@ def test_monitoring_ports(self, _run_cephadm, cephadm_module: CephadmOrchestrato
14181418
"deploy_arguments": [],
14191419
"params": {
14201420
'tcp_ports': [4200, 9094],
1421-
'reconfig': True,
14221421
},
14231422
"meta": {
14241423
'service_name': 'alertmanager',
@@ -1432,7 +1431,7 @@ def test_monitoring_ports(self, _run_cephadm, cephadm_module: CephadmOrchestrato
14321431
},
14331432
"config_blobs": {},
14341433
}),
1435-
use_current_daemon_image=True,
1434+
use_current_daemon_image=False,
14361435
)
14371436

14381437

0 commit comments

Comments
 (0)