]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use host address while updating rgw zone endpoints 59948/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:36:28 +0000 (12:06 +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 561a3e085b8633af0170934f699d42ae0863f78f..2cc2044e26f947b2f767633c535c89beb0077cb2 100644 (file)
@@ -663,7 +663,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,