Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/warnet/ln.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 72 to +77
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah yeah, I know and explained it: helm set exactly same value for the pod and the service, so by using pod name it's also service name and resolves correctly. Also for CLN it's the exact same string that was returned earlier.

Loading