Skip to content

Commit 007a351

Browse files
committed
grep_logs: minor change; seems to work
1 parent 7d4aa5d commit 007a351

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/warnet/bitcoin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def grep_logs(pattern: str, show_k8s_timestamps: bool, no_sort: bool):
8989
"""
9090
Grep combined bitcoind logs using regex <pattern>
9191
"""
92+
sclient = get_static_client()
9293

9394
try:
9495
tanks = get_mission("tank")
@@ -111,8 +112,12 @@ def grep_logs(pattern: str, show_k8s_timestamps: bool, no_sort: bool):
111112
continue
112113

113114
# Get logs from the specific container
114-
command = f"kubectl logs {pod_name} -c {container_name} --timestamps"
115-
logs = run_command(command)
115+
logs = sclient.read_namespaced_pod_log(
116+
name=pod_name,
117+
namespace=get_default_namespace(),
118+
container=container_name,
119+
timestamps=True,
120+
)
116121

117122
if logs is not False:
118123
# Process logs

0 commit comments

Comments
 (0)