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

linying pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 5fd07601e fix watch job bug (#2997)
5fd07601e is described below

commit 5fd07601eda2eac234deb2011005e78c485cd40e
Author: blackCat <[email protected]>
AuthorDate: Wed Aug 30 16:00:10 2023 +0800

    fix watch job bug (#2997)
---
 .../flink/kubernetes/helper/KubernetesDeploymentHelper.scala      | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/helper/KubernetesDeploymentHelper.scala
 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/helper/KubernetesDeploymentHelper.scala
index dc23a0f2a..8e622fe04 100644
--- 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/helper/KubernetesDeploymentHelper.scala
+++ 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/helper/KubernetesDeploymentHelper.scala
@@ -58,7 +58,13 @@ object KubernetesDeploymentHelper extends Logger {
   def getDeploymentStatusChanges(nameSpace: String, deploymentName: String): 
Boolean = {
     Try {
       val pods = getPods(nameSpace, deploymentName)
-      pods.head.getStatus.getContainerStatuses.head.getLastState.getTerminated 
!= null
+      val podStatus = pods.head.getStatus
+      podStatus.getPhase match {
+        case "Unknown" => return true
+        case "Failed" => return true
+        case "Pending" => return false
+        case _ => 
podStatus.getContainerStatuses.head.getLastState.getTerminated != null
+      }
     }.getOrElse(true)
   }
 

Reply via email to