Skip to content

Commit 85c40b0

Browse files
author
Muhammad Labeeb
committed
feat: add max_log_requests argument in command tutor k8s logs
1 parent 4ddd343 commit 85c40b0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Feature] Add max-log-requests parameter for command `tutor k8s logs`. (by @mlabeeb03)

tutor/commands/k8s.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,23 +439,34 @@ def exec_command(context: K8sContext, service: str, args: List[str]) -> None:
439439
@click.option("-c", "--container", help="Print the logs of this specific container")
440440
@click.option("-f", "--follow", is_flag=True, help="Follow log output")
441441
@click.option("--tail", type=int, help="Number of lines to show from each container")
442+
@click.option(
443+
"--max_log_requests",
444+
type=int,
445+
help="Maximum allowed concurrency while streaming logs",
446+
)
442447
@click.argument("service")
443448
@click.pass_obj
444449
def logs(
445-
context: K8sContext, container: str, follow: bool, tail: bool, service: str
450+
context: K8sContext,
451+
container: str,
452+
follow: bool,
453+
tail: bool,
454+
max_log_requests: int,
455+
service: str,
446456
) -> None:
447457
config = tutor_config.load(context.root)
448458

449459
command = ["logs"]
450460
selectors = ["app.kubernetes.io/name=" + service] if service else []
451461
command += resource_selector(config, *selectors)
452-
453462
if container:
454463
command += ["-c", container]
455464
if follow:
456465
command += ["--follow"]
457466
if tail is not None:
458467
command += ["--tail", str(tail)]
468+
if max_log_requests is not None:
469+
command += ["--max-log-requests", str(max_log_requests)]
459470

460471
utils.kubectl(*command)
461472

0 commit comments

Comments
 (0)