]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use host address while updating rgw zone endpoints 59728/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>
Fri, 13 Sep 2024 07:11:52 +0000 (12:41 +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>
src/pybind/mgr/cephadm/serve.py

index 822194e117cbd0323f1dcb1d45bc8e5922ec7312..c6212c9efb83db9d45bd17ed1d5692461cd2c820 100644 (file)
@@ -691,7 +691,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,