From 66da00641d1c89a0e5e8c7505e0d0f5d12de793a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juho=20Yrj=C3=B6l=C3=A4?= Date: Fri, 5 Jun 2026 11:21:26 +0300 Subject: [PATCH] Get ln node host from pod name --- src/warnet/ln.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/warnet/ln.py b/src/warnet/ln.py index e01df85f8..dee8b9f5d 100644 --- a/src/warnet/ln.py +++ b/src/warnet/ln.py @@ -70,13 +70,8 @@ def host( def _host(pod_name: str): - info = _rpc(pod_name, "getinfo") pod = get_pod(pod_name) - if "cln" in pod.metadata.labels["app.kubernetes.io/name"]: - return json.loads(info)["alias"] - else: - uris = json.loads(info)["uris"] - if uris and len(uris) >= 0: - return uris[0].split("@")[1] - else: - return "" + + # pod name (lnd.fullname / cln.fullname) matches the configs + # 'announce-addr' and 'externalhosts' in configmaps + return pod.metadata.name + "." + pod.metadata.namespace