Fix the sinceSeconds parameter for the logs
Fix cases where too few or too many logs are shown
@@ -111,7 +111,12 @@ func (a *LogAggregator) streamLogs(client corev1.CoreV1Interface, pod *v1.Pod) e
logrus.Infof("Stream logs from pod: %s container: %s", pod.Name, container.Name)
- sinceSeconds := int64(time.Since(a.startTime))
+ sinceSeconds := int64(time.Since(a.startTime).Seconds())
+ // 0s means all the logs
+ if sinceSeconds == 0 {
+ sinceSeconds = 1
+ }
+
req := pods.GetLogs(pod.Name, &v1.PodLogOptions{
Follow: true,
Container: container.Name,
