Allow param tail to be used without param since
This allows user to look at last N lines of logs without getting
restricted by the time when those lines were logged
@@ -97,13 +97,16 @@ func podLogs(ctx context.Context, i v1.PodInterface, pod, container, namespace s
Follow: follow,
Timestamps: true,
Container: container,
- SinceSeconds: parseSince(since),
}
if tail > 0 {
opts.TailLines = &tail
}
+ if opts.TailLines == nil || since != nil {
+ opts.SinceSeconds = parseSince(since)
+ }
+
stream, err := i.GetLogs(pod, opts).Stream()
if err != nil {
return err
