Skip to content

Commit ac3e6e5

Browse files
authored
Merge pull request ceph#62299 from thegreenbear/cephadm-sd-fix-haproxy-labels
src/pybind/mgr/cephadm/service_discovery: fixed HAProxy labels Reviewed-by: Adam King <[email protected]> Reviewed-by: Afreen Misbah <[email protected]>
2 parents d28e5fe + 608c0de commit ac3e6e5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/pybind/mgr/cephadm/service_discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def haproxy_sd_config(self) -> List[Dict[str, Collection[str]]]:
228228
addr = self.mgr.inventory.get_addr(dd.hostname)
229229
srv_entries.append({
230230
'targets': [f"{build_url(host=addr, port=spec.monitor_port).lstrip('/')}"],
231-
'labels': {'instance': dd.service_name()}
231+
'labels': {'ingress': dd.service_name(), 'instance': dd.hostname}
232232
})
233233
return srv_entries
234234

src/pybind/mgr/cephadm/tests/test_service_discovery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def test_get_sd_config_haproxy(self):
170170

171171
# check content
172172
assert cfg[0]['targets'] == ['1.2.3.4:9049']
173-
assert cfg[0]['labels'] == {'instance': 'ingress'}
173+
assert cfg[0]['labels'] == {'instance': 'node0', 'ingress': 'ingress'}
174+
assert cfg[1]['labels'] == {'instance': 'node1', 'ingress': 'ingress'}
174175

175176
def test_get_sd_config_ceph_exporter(self):
176177
mgr = FakeMgr()

0 commit comments

Comments
 (0)