diff --git a/worker/appm/types/v1/status.go b/worker/appm/types/v1/status.go index e6635ec79..724597367 100644 --- a/worker/appm/types/v1/status.go +++ b/worker/appm/types/v1/status.go @@ -191,9 +191,12 @@ func (a *AppService) GetServiceStatus() string { } return RUNNING } - if a.job != nil { + if a.cronjob != nil { succeed := 0 failed := 0 + if len(a.pods) == 0 { + return RUNNING + } for _, po := range a.pods { if po.Status.Phase == "Succeeded" { succeed++ @@ -203,19 +206,17 @@ func (a *AppService) GetServiceStatus() string { } } if len(a.pods) == succeed { - return SUCCEEDED + return RUNNING } if failed > 0 { return ABNORMAL } return RUNNING } - if a.cronjob != nil { + + if a.job != nil { succeed := 0 failed := 0 - if len(a.pods) == 0 { - return RUNNING - } for _, po := range a.pods { if po.Status.Phase == "Succeeded" { succeed++ @@ -225,13 +226,14 @@ func (a *AppService) GetServiceStatus() string { } } if len(a.pods) == succeed { - return RUNNING + return SUCCEEDED } if failed > 0 { return ABNORMAL } return RUNNING } + if a.statefulset == nil && a.deployment == nil && len(a.pods) > 0 { return STOPPING }