Merge pull request #125520 from mimowo/cleanup-success-policy-check

Remove redundant check in Job success policy code
This commit is contained in:
Kubernetes Prow Robot 2024-06-18 12:40:09 -07:00 committed by GitHub
commit bd88faee8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -880,7 +880,7 @@ func (jm *Controller) syncJob(ctx context.Context, key string) (rErr error) {
}
jobCtx.podsWithDelayedDeletionPerIndex = getPodsWithDelayedDeletionPerIndex(logger, jobCtx)
}
if jobCtx.finishedCondition == nil && hasSuccessCriteriaMetCondition(jobCtx.job) == nil {
if jobCtx.finishedCondition == nil {
if msg, met := matchSuccessPolicy(logger, job.Spec.SuccessPolicy, *job.Spec.Completions, jobCtx.succeededIndexes); met {
jobCtx.finishedCondition = newCondition(batch.JobSuccessCriteriaMet, v1.ConditionTrue, batch.JobReasonSuccessPolicy, msg, jm.clock.Now())
}