From f3af73b6e312e2087ca0fc98caeaca3db9bd02d7 Mon Sep 17 00:00:00 2001 From: Matias Manavella Date: Wed, 21 Oct 2020 14:49:46 -0300 Subject: [PATCH] nil and error handling --- pkg/collect/logs.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/collect/logs.go b/pkg/collect/logs.go index 885f3d90..9c2a8321 100644 --- a/pkg/collect/logs.go +++ b/pkg/collect/logs.go @@ -138,11 +138,10 @@ func getPodLogs(ctx context.Context, client *kubernetes.Clientset, pod corev1.Po fmt.Println("time", t) if err != nil { logger.Printf("unable to parse --since-time=%s\n", limits.SinceTime) + } else { + sinceTime := metav1.NewTime(t) + podLogOpts.SinceTime = &sinceTime } - - sinceTime := metav1.NewTime(t) - podLogOpts.SinceTime = &sinceTime - } fileKey := fmt.Sprintf("%s/%s", name, pod.Name) if container != "" {