Skip to content

Commit

Permalink
fix watch job bug (#2997)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshaojin authored Aug 30, 2023
1 parent 81c73c3 commit 5fd0760
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 5fd0760

Please sign in to comment.