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)
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,