Skip to content

Commit 3f080fd

Browse files
committed
cli: add 'port_forward' subcommand for ln
1 parent e158f3f commit 3f080fd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/warnet/ln.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
get_default_namespace_or,
88
get_pod,
99
)
10-
from .process import run_command
10+
from .process import run_command, stream_command
1111

1212

1313
@click.group(name="ln")
@@ -69,3 +69,16 @@ def _host(pod):
6969
return uris[0].split("@")[1]
7070
else:
7171
return ""
72+
73+
@ln.command()
74+
@click.argument("pod", type=str)
75+
@click.argument("local_port", type=int)
76+
def port_forward(
77+
pod: str,
78+
local_port: int
79+
):
80+
"""
81+
Port forward lightning node from <ln pod name>
82+
"""
83+
command = f"kubectl port-forward {pod} {local_port}:10009"
84+
return stream_command(command)

0 commit comments

Comments
 (0)