This is an automated email from the ASF dual-hosted git repository.

style95 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new b32100d  Fix k8s log error (#4933)
b32100d is described below

commit b32100ddd96f434b3bbee9bf334fba1084405426
Author: jiangpch <[email protected]>
AuthorDate: Wed Jul 29 14:27:11 2020 +0800

    Fix k8s log error (#4933)
    
    Co-authored-by: jiang.pengcheng <[email protected]>
---
 .../openwhisk/core/containerpool/kubernetes/KubernetesClient.scala  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala
 
b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala
index a07a89f..87e650f 100644
--- 
a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala
+++ 
b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala
@@ -20,6 +20,7 @@ package org.apache.openwhisk.core.containerpool.kubernetes
 import java.io.IOException
 import java.net.SocketTimeoutException
 import java.time.format.DateTimeFormatterBuilder
+import java.time.temporal.ChronoField
 import java.time.{Instant, ZoneId}
 
 import akka.actor.ActorSystem
@@ -331,7 +332,8 @@ object KubernetesClient {
     .parseCaseInsensitive()
     .appendPattern("u-MM-dd")
     .appendLiteral('T')
-    .appendPattern("HH:mm:ss[.n]")
+    .appendPattern("HH:mm:ss")
+    .appendFraction(ChronoField.NANO_OF_SECOND, 1, 9, true)
     .appendLiteral('Z')
     .toFormatter()
     .withZone(ZoneId.of("UTC"))
@@ -401,7 +403,7 @@ object KubernetesRestLogSourceStage {
         TypedLogLine(timestamp, stream, msg)
       }) match {
         case Some(logLine) =>
-          readLines(src, Option(logLine.time), lines :+ logLine)
+          readLines(src, lastTimestamp, lines :+ logLine)
         case None =>
           // we may have skipped a line for filtering conditions only; keep 
going
           readLines(src, lastTimestamp, lines)

Reply via email to