Skip to content

Commit

Permalink
feat(Get-KubeLog): Add -Tail parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed Mar 1, 2019
1 parent 1559756 commit d409ff4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Cmdlets/GetKubeLogCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ public class GetKubeLogCmdlet : KubeApiCmdlet {
[Parameter()]
public int? LimitBytes { get; set; }

[Parameter()]
public int? Tail { get; set; }

protected override async Task ProcessRecordAsync(CancellationToken cancellationToken) {
base.BeginProcessing();
if (Follow) {
IObservable<string> logs = client.PodsV1().StreamLogs(
kubeNamespace: Namespace,
name: Name,
containerName: Container,
limitBytes: LimitBytes
limitBytes: LimitBytes,
tailLines: Tail
);
await logs.ObserveOn(SynchronizationContext.Current).ForEachAsync(WriteObject, cancellationToken);
} else {
Expand All @@ -46,6 +50,7 @@ protected override async Task ProcessRecordAsync(CancellationToken cancellationT
name: Name,
containerName: Container,
limitBytes: LimitBytes,
tailLines: Tail,
cancellationToken: cancellationToken
);
WriteObject(logs);
Expand Down

0 comments on commit d409ff4

Please sign in to comment.