@@ -101,8 +101,9 @@ def to_lnd_chanpolicy(self, capacity):
101101
102102class LNNode (ABC ):
103103 @abstractmethod
104- def __init__ (self , pod_name , ip_address ):
104+ def __init__ (self , pod_name , pod_namespace , ip_address ):
105105 self .name = pod_name
106+ self .namespace = pod_namespace
106107 self .ip_address = ip_address
107108 self .log = logging .getLogger (pod_name )
108109 handler = logging .StreamHandler ()
@@ -152,16 +153,16 @@ def update(self, txid_hex: str, policy: dict, capacity: int) -> dict:
152153
153154
154155class CLN (LNNode ):
155- def __init__ (self , pod_name , ip_address ):
156- super ().__init__ (pod_name , ip_address )
156+ def __init__ (self , pod_name , pod_namespace , ip_address ):
157+ super ().__init__ (pod_name , pod_namespace , ip_address )
157158 self .conn = None
158159 self .headers = {}
159160 self .impl = "cln"
160161 self .reset_connection ()
161162
162163 def reset_connection (self ):
163164 self .conn = http .client .HTTPSConnection (
164- host = self .name , port = 3010 , timeout = 60 , context = INSECURE_CONTEXT
165+ host = f" { self .name } . { self . namespace } " , port = 3010 , timeout = 60 , context = INSECURE_CONTEXT
165166 )
166167
167168 def setRune (self , rune ):
@@ -285,11 +286,9 @@ def update(self, txid_hex: str, policy: dict, capacity: int) -> dict:
285286
286287
287288class LND (LNNode ):
288- def __init__ (self , pod_name , ip_address , admin_macaroon_hex ):
289- super ().__init__ (pod_name , ip_address )
290- self .conn = http .client .HTTPSConnection (
291- host = pod_name , port = 8080 , timeout = 5 , context = INSECURE_CONTEXT
292- )
289+ def __init__ (self , pod_name , pod_namespace , ip_address , admin_macaroon_hex ):
290+ super ().__init__ (pod_name , pod_namespace , ip_address )
291+ self .conn = None
293292 self .admin_macaroon_hex = admin_macaroon_hex
294293 self .headers = {
295294 "Grpc-Metadata-macaroon" : admin_macaroon_hex ,
@@ -299,7 +298,7 @@ def __init__(self, pod_name, ip_address, admin_macaroon_hex):
299298
300299 def reset_connection (self ):
301300 self .conn = http .client .HTTPSConnection (
302- host = self .name , port = 8080 , timeout = 60 , context = INSECURE_CONTEXT
301+ host = f" { self .name } . { self . namespace } " , port = 8080 , timeout = 60 , context = INSECURE_CONTEXT
303302 )
304303
305304 def get (self , uri ):
0 commit comments