From: Aashish Sharma Date: Wed, 11 Sep 2024 11:07:09 +0000 (+0530) Subject: mgr/cephadm: use host address while updating rgw zone endpoints X-Git-Tag: v18.2.5~88^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45e466647633e1243dacd9dc3d5c908c4844d84b;p=ceph.git mgr/cephadm: use host address while updating rgw zone endpoints During Import zone endpoint automatically fetches hostname instead of ip resulting in sync error. This PR is to fix this issue https://tracker.ceph.com/issues/68027 Signed-off-by: Aashish Sharma (cherry picked from commit 55a2ffb342c24f11c375c88a7f16c7042f6edcea) --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index ce5db4990f734..b6cecd86c84e9 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -641,7 +641,11 @@ class CephadmServe: for s in self.mgr.cache.get_daemons_by_service(rgw_spec.service_name()): if s.ports: for p in s.ports: - ep.append(f'{protocol}://{s.hostname}:{p}') + if s.hostname is not None: + host_addr = self.mgr.inventory.get_addr(s.hostname) + ep.append(f'{protocol}://{host_addr}:{p}') + else: + logger.error("Hostname is None for service: %s", s) zone_update_cmd = { 'prefix': 'rgw zone modify', 'realm_name': rgw_spec.rgw_realm,