Skip to content

Commit

Permalink
Job: Update the comment when the Job already has the SuccessCriteriaM…
Browse files Browse the repository at this point in the history
…et condition

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Feb 29, 2024
1 parent af26f57 commit 134a16f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controller/job/job_controller.go
Expand Up @@ -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())
Expand Down

0 comments on commit 134a16f

Please sign in to comment.