]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix mgr ports list growth; add unit tests (#76564) 68915/head
authorKobi Ginon <kginon@redhat.com>
Fri, 15 May 2026 16:22:30 +0000 (19:22 +0300)
committerKobi Ginon <kginon@redhat.com>
Fri, 15 May 2026 16:34:12 +0000 (19:34 +0300)
commitdaa0a2f018e1681044911d322b7fd1b88e988d08
treea70e9385d37a777b940ad1eae9ae6796130cffdc
parenta036f77654dc50960f20b361769050759fc36c16
cephadm: fix mgr ports list growth; add unit tests (#76564)

Problem
-------
MgrService.prepare_create built module ports from ``mgr services`` but
only assigned them when non-empty, then always appended
service_discovery_port. After rehydration from mgr/cephadm/host.*, an
empty ``mgr services`` response left stale ports in place and appended
another 8765 each redeploy (https://tracker.ceph.com/issues/76564).

Fix
---
Always set ``daemon_spec.ports = ports + [service_discovery_port]`` so
each prepare uses a fresh list plus exactly one discovery port.

Tests
-----
Add src/pybind/mgr/cephadm/tests/services/test_mgr.py: empty vs
non-empty ``mgr services`` with carried-over duplicate ports. Cases
consolidated from parallel PR https://github.com/ceph/ceph/pull/68879 .

Authors
-------
Kobi Ginon (@kginonredhat) — fix + test integration for this PR.
Raimund Sacherer (@rsacherer) — original fix + tests in #68879;
coordinated to land a single PR (#68915).

Fixes: https://tracker.ceph.com/issues/76564
Signed-off-by: Kobi Ginon <kginon@redhat.com>
Signed-off-by: Raimund Sacherer <rsachere@redhat.com>
src/pybind/mgr/cephadm/tests/services/test_mgr.py [new file with mode: 0644]