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
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 @@ public class GetKubeLogCmdlet : KubeApiCmdlet {
name: Name,
containerName: Container,
limitBytes: LimitBytes,
tailLines: Tail,
cancellationToken: cancellationToken
);
WriteObject(logs);
Expand Down

0 comments on commit d409ff4

Please sign in to comment.