Skip to content

Commit d40a028

Browse files
authored
Merge pull request ceph#59728 from rhcs-dashboard/replace-hostname-addr-rgw
mgr/cephadm: use host address while updating rgw zone endpoints Reviewed-by: Adam King <[email protected]>
2 parents 000598c + 55a2ffb commit d40a028

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pybind/mgr/cephadm/serve.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,11 @@ def _update_rgw_endpoints(self, rgw_spec: RGWSpec) -> None:
691691
for s in self.mgr.cache.get_daemons_by_service(rgw_spec.service_name()):
692692
if s.ports:
693693
for p in s.ports:
694-
ep.append(f'{protocol}://{s.hostname}:{p}')
694+
if s.hostname is not None:
695+
host_addr = self.mgr.inventory.get_addr(s.hostname)
696+
ep.append(f'{protocol}://{host_addr}:{p}')
697+
else:
698+
logger.error("Hostname is None for service: %s", s)
695699
zone_update_cmd = {
696700
'prefix': 'rgw zone modify',
697701
'realm_name': rgw_spec.rgw_realm,

0 commit comments

Comments
 (0)