Merge pull request #122493 from mengjiao-liu/fix-cronjob-error

cronjob: fix incorrect error checking
This commit is contained in:
Kubernetes Prow Robot
2024-02-27 14:14:54 -08:00
committed by GitHub

View File

@@ -203,8 +203,8 @@ func (jm *ControllerV2) sync(ctx context.Context, cronJobKey string) (*time.Dura
updateStatusAfterCleanup := jm.cleanupFinishedJobs(ctx, cronJobCopy, jobsToBeReconciled)
requeueAfter, updateStatusAfterSync, syncErr := jm.syncCronJob(ctx, cronJobCopy, jobsToBeReconciled)
if err != nil {
logger.V(2).Info("Error reconciling cronjob", "cronjob", klog.KObj(cronJob), "err", err)
if syncErr != nil {
logger.V(2).Info("Error reconciling cronjob", "cronjob", klog.KObj(cronJob), "err", syncErr)
}
// Update the CronJob if needed