Skip to content

Commit afda17c

Browse files
committed
use default namespace when checking network connections
1 parent efbb59f commit afda17c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/warnet/bitcoin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from test_framework.messages import ser_uint256
1111
from test_framework.p2p import MESSAGEMAP
1212

13-
from .k8s import get_mission
13+
from .k8s import get_default_namespace, get_mission
1414
from .process import run_command
1515

1616

@@ -38,10 +38,11 @@ def rpc(tank: str, method: str, params: str):
3838
def _rpc(tank: str, method: str, params: str):
3939
# bitcoin-cli should be able to read bitcoin.conf inside the container
4040
# so no extra args like port, chain, username or password are needed
41+
namespace = get_default_namespace()
4142
if params:
42-
cmd = f"kubectl exec {tank} -- bitcoin-cli {method} {' '.join(map(str, params))}"
43+
cmd = f"kubectl -n {namespace} exec {tank} -- bitcoin-cli {method} {' '.join(map(str, params))}"
4344
else:
44-
cmd = f"kubectl exec {tank} -- bitcoin-cli {method}"
45+
cmd = f"kubectl -n {namespace} exec {tank} -- bitcoin-cli {method}"
4546
return run_command(cmd)
4647

4748

0 commit comments

Comments
 (0)