Skip to content

Commit e84416b

Browse files
committed
bitcoin: use get_pod and get_service
1 parent 6d8ffa0 commit e84416b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/warnet/bitcoin.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
from io import BytesIO
88

99
import click
10-
from kubernetes.client.models import V1Pod, V1Service
1110
from kubernetes.stream import stream
1211
from urllib3.exceptions import MaxRetryError
1312

1413
from test_framework.messages import ser_uint256
1514
from test_framework.p2p import MESSAGEMAP
1615

17-
from .k8s import get_default_namespace, get_mission, get_static_client, kexec, pod_log
16+
from .k8s import (
17+
get_default_namespace,
18+
get_mission,
19+
get_pod,
20+
get_service,
21+
get_static_client,
22+
kexec,
23+
pod_log,
24+
)
1825
from .process import run_command
1926

2027

@@ -207,19 +214,15 @@ def get_messages(tank_a: str, tank_b: str, chain: str):
207214
"""
208215
Fetch messages from the message capture files
209216
"""
210-
sclient = get_static_client()
211-
212217
subdir = "" if chain == "main" else f"{chain}/"
213218
base_dir = f"/root/.bitcoin/{subdir}message_capture"
214219

215220
# Get the IP of node_b
216-
tank_b_pod: V1Pod = sclient.read_namespaced_pod(name=tank_b, namespace=get_default_namespace())
221+
tank_b_pod = get_pod(tank_b)
217222
tank_b_ip = tank_b_pod.status.pod_ip
218223

219224
# Get the service IP of node_b
220-
tank_b_service: V1Service = sclient.read_namespaced_service(
221-
name=tank_b, namespace=get_default_namespace()
222-
)
225+
tank_b_service = get_service(tank_b)
223226
tank_b_service_ip = tank_b_service.spec.cluster_ip
224227

225228
# List directories in the message capture folder

0 commit comments

Comments
 (0)