From 134a16f21825edf4aedbb540a3ce3a841e8eb5e3 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Fri, 1 Mar 2024 02:46:56 +0900 Subject: [PATCH] Job: Update the comment when the Job already has the SuccessCriteriaMet condition Signed-off-by: Yuki Iwai --- pkg/controller/job/job_controller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index 8c924d4c2f3c..4c665eff4de8 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -813,6 +813,8 @@ func (jm *Controller) syncJob(ctx context.Context, key string) (rErr error) { jobCtx.successCondition = findConditionByType(jobCtx.job.Status.Conditions, batch.JobSuccessCriteriaMet) } + // Given that the Job already has the SuccessCriteriaMet condition, the termination condition already had confirmed in another cycle. + // So, the job-controller evaluates the podFailurePolicy only when the Job doesn't have the SuccessCriteriaMet condition. if feature.DefaultFeatureGate.Enabled(features.JobPodFailurePolicy) && jobCtx.successCondition == nil { if failureTargetCondition := findConditionByType(job.Status.Conditions, batch.JobFailureTarget); failureTargetCondition != nil { jobCtx.failureCondition = newFailedConditionForFailureTarget(failureTargetCondition, jm.clock.Now())