mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 18:11:22 +00:00
Merge pull request #104799 from RyanAoh/cronjob_dev
fix the error when cleaning up finished jobs for cronjob
This commit is contained in:
@@ -613,13 +613,14 @@ func (jm *ControllerV2) syncCronJob(
|
||||
}
|
||||
cj.Status.Active = append(cj.Status.Active, *jobRef)
|
||||
cj.Status.LastScheduleTime = &metav1.Time{Time: *scheduledTime}
|
||||
if _, err := jm.cronJobControl.UpdateStatus(ctx, cj); err != nil {
|
||||
updatedCJ, err = jm.cronJobControl.UpdateStatus(ctx, cj)
|
||||
if err != nil {
|
||||
klog.InfoS("Unable to update status", "cronjob", klog.KRef(cj.GetNamespace(), cj.GetName()), "resourceVersion", cj.ResourceVersion, "err", err)
|
||||
return cj, nil, fmt.Errorf("unable to update status for %s (rv = %s): %v", klog.KRef(cj.GetNamespace(), cj.GetName()), cj.ResourceVersion, err)
|
||||
}
|
||||
|
||||
t := nextScheduledTimeDuration(sched, now)
|
||||
return cj, t, nil
|
||||
return updatedCJ, t, nil
|
||||
}
|
||||
|
||||
func getJobName(cj *batchv1.CronJob, scheduledTime time.Time) string {
|
||||
|
Reference in New Issue
Block a user