Merge pull request #116102 from danielvegamyhre/strategy-nit

Move AllowElasticIndexedJobs into JobValidationOptions declaration
This commit is contained in:
Kubernetes Prow Robot 2023-02-27 19:25:26 -08:00 committed by GitHub
commit aad3050519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,6 +169,7 @@ func validationOptionsForJob(newJob, oldJob *batch.Job) batchvalidation.JobValid
opts := batchvalidation.JobValidationOptions{
PodValidationOptions: pod.GetValidationOptionsFromPodTemplate(newPodTemplate, oldPodTemplate),
AllowTrackingAnnotation: true,
AllowElasticIndexedJobs: utilfeature.DefaultFeatureGate.Enabled(features.ElasticIndexedJob),
}
if oldJob != nil {
opts.AllowInvalidLabelValueInSelector = opts.AllowInvalidLabelValueInSelector || metav1validation.LabelSelectorHasInvalidLabelValue(oldJob.Spec.Selector)
@ -185,9 +186,6 @@ func validationOptionsForJob(newJob, oldJob *batch.Job) batchvalidation.JobValid
opts.AllowMutableSchedulingDirectives = utilfeature.DefaultFeatureGate.Enabled(features.JobMutableNodeSchedulingDirectives) &&
suspended && notStarted
}
// Elastic indexed jobs (mutable completions iff updated parallelism == updated completions)
opts.AllowElasticIndexedJobs = utilfeature.DefaultFeatureGate.Enabled(features.ElasticIndexedJob)
return opts
}