diff --git a/operator-suite/src/main/java/io/brokerqe/claire/KubeClient.java b/operator-suite/src/main/java/io/brokerqe/claire/KubeClient.java index 8eaac59..f5e4215 100644 --- a/operator-suite/src/main/java/io/brokerqe/claire/KubeClient.java +++ b/operator-suite/src/main/java/io/brokerqe/claire/KubeClient.java @@ -766,7 +766,10 @@ public String getLogsFromPod(Pod pod, Instant sinceInstant, int sinceSeconds) { if (sinceInstant == null && sinceSeconds == -1) { return getKubernetesClient().pods().inNamespace(pod.getMetadata().getNamespace()).resource(pod).getLog(); } else if (sinceInstant != null) { - // TODO problem with time zones (UTC is not guaranteed) + // If seconds is zero, atOffset().toString() will truncate the string + // which the pod cannot parse, causing an error + if (sinceInstant.atOffset(ZoneOffset.UTC).getSecond() == 0) + sinceInstant = sinceInstant.minusSeconds(1); return getKubernetesClient().pods().inNamespace(pod.getMetadata().getNamespace()).resource(pod) .sinceTime(sinceInstant.atOffset(ZoneOffset.UTC).toString()).getLog(); } else {