From d409ff4a3d4bf8e669aaceb4feb2c215b9f9b22a Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Fri, 1 Mar 2019 09:49:28 +0100 Subject: [PATCH] feat(Get-KubeLog): Add -Tail parameter --- src/Cmdlets/GetKubeLogCmdlet.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Cmdlets/GetKubeLogCmdlet.cs b/src/Cmdlets/GetKubeLogCmdlet.cs index 9a137cc..be5cdf0 100644 --- a/src/Cmdlets/GetKubeLogCmdlet.cs +++ b/src/Cmdlets/GetKubeLogCmdlet.cs @@ -30,6 +30,9 @@ 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) { @@ -37,7 +40,8 @@ protected override async Task ProcessRecordAsync(CancellationToken cancellationT kubeNamespace: Namespace, name: Name, containerName: Container, - limitBytes: LimitBytes + limitBytes: LimitBytes, + tailLines: Tail ); await logs.ObserveOn(SynchronizationContext.Current).ForEachAsync(WriteObject, cancellationToken); } else { @@ -46,6 +50,7 @@ protected override async Task ProcessRecordAsync(CancellationToken cancellationT name: Name, containerName: Container, limitBytes: LimitBytes, + tailLines: Tail, cancellationToken: cancellationToken ); WriteObject(logs);