feat: handle job run error and change life-cycle status
This commit is contained in:
@@ -48,10 +48,17 @@ func (job *ManagedJob) run(restoreMode bool) error {
|
||||
jobId = &runJarResp.JobId
|
||||
break
|
||||
} else {
|
||||
if strings.ContainsAny(err.Error(), ".jar does not exist") {
|
||||
if strings.Contains(err.Error(), ".jar does not exist") {
|
||||
pkg.Logger.Error("[managed-job] [run] unhandled jar run Flink error", zap.Error(err))
|
||||
shouldUpload = true
|
||||
} else {
|
||||
pkg.Logger.Error("[managed-job] [run] unhandled jar run Flink error", zap.Error(err))
|
||||
stringErr := err.Error()
|
||||
job.def.Status.Error = &stringErr
|
||||
job.def.Status.JobStatus = ""
|
||||
job.def.Status.LifeCycleStatus = v1alpha1.LifeCycleStatusFailed
|
||||
job.crd.SetJobStatus(job.def.UID, job.def.Status)
|
||||
return v1alpha1.ErrOnStartingJob
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +73,7 @@ func (job *ManagedJob) run(restoreMode bool) error {
|
||||
})
|
||||
return nil
|
||||
}
|
||||
shouldUpload = false
|
||||
continue
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user