feat: handle job run error and change life-cycle status

This commit is contained in:
2024-12-18 10:08:30 +03:30
parent 03fe9910a3
commit 5e3f093f08
6 changed files with 15 additions and 5 deletions

View File

@@ -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