]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use host address while updating rgw zone endpoints 59947/head
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Wed, 11 Sep 2024 11:07:09 +0000 (16:37 +0530)
committerAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Tue, 24 Sep 2024 06:35:34 +0000 (12:05 +0530)
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 <aasharma@redhat.com>
(cherry picked from commit 55a2ffb342c24f11c375c88a7f16c7042f6edcea)

src/pybind/mgr/cephadm/serve.py

index ce5db4990f7343dc897d28f90cf87a4673119280..b6cecd86c84e982b44b21745ccc45ca76dcf116e 100644 (file)
@@ -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,