fix: wong update status in some situations
This commit is contained in:
parent
346f69100c
commit
556d9ff6af
@ -1,4 +1,4 @@
|
||||
FROM public.ecr.aws/docker/library/golang:1.23.4-bookworm AS build
|
||||
FROM public.ecr.aws/docker/library/golang:1.24.1-bookworm AS build
|
||||
|
||||
ARG upx_version=4.2.4
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ func (job *ManagedJob) Cycle() {
|
||||
// pkg.Logger.Debug("[managed-job] [new] check cycle", zap.String("jobName", job.def.GetName()))
|
||||
|
||||
// Init job
|
||||
if job.def.Status.LifeCycleStatus == "" && job.def.Status.JobStatus == "" {
|
||||
if job.def.Status.LifeCycleStatus == "" && (job.def.Status.JobStatus == "" || job.def.Status.JobStatus == v1alpha1.JobStatusFinished) {
|
||||
job.Run(false)
|
||||
return
|
||||
}
|
||||
|
||||
@ -119,14 +119,15 @@ func (mgr *Manager) cycle(client *api.Client, crdInstance *crd.Crd) {
|
||||
"status": patchStatusObj,
|
||||
})
|
||||
} else {
|
||||
patchStatusObj := map[string]interface{}{
|
||||
"jobStatus": "",
|
||||
"lifeCycleStatus": string(v1alpha1.LifeCycleStatusFailed),
|
||||
}
|
||||
// TODO handle job not found status
|
||||
// patchStatusObj := map[string]interface{}{
|
||||
// "jobStatus": "",
|
||||
// "lifeCycleStatus": string(v1alpha1.LifeCycleStatusFailed),
|
||||
// }
|
||||
|
||||
crdInstance.Patch(uid, map[string]interface{}{
|
||||
"status": patchStatusObj,
|
||||
})
|
||||
// crdInstance.Patch(uid, map[string]interface{}{
|
||||
// "status": patchStatusObj,
|
||||
// })
|
||||
}
|
||||
|
||||
managedJob.Cycle()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user