change test names and address other comments

This commit is contained in:
Daniel Vega-Myhre
2023-02-17 23:02:05 +00:00
parent b0b0959b92
commit c63f448451
2 changed files with 30 additions and 39 deletions

View File

@@ -568,13 +568,15 @@ func ValidateJobTemplateSpec(spec *batch.JobTemplateSpec, fldPath *field.Path, o
}
func validateCompletions(spec, oldSpec batch.JobSpec, fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
if !feature.DefaultFeatureGate.Enabled(features.ElasticIndexedJob) {
return apivalidation.ValidateImmutableField(spec.Completions, oldSpec.Completions, fldPath)
}
// Completions is immutable for non-indexed jobs.
// For Indexed Jobs, if ElasticIndexedJob feature gate is not enabled,
// fall back to validating that spec.Completions is always immutable.
var allErrs field.ErrorList
isIndexedJob := spec.CompletionMode != nil && *spec.CompletionMode == batch.IndexedCompletion
if !isIndexedJob || !feature.DefaultFeatureGate.Enabled(features.ElasticIndexedJob) {
if !isIndexedJob {
return apivalidation.ValidateImmutableField(spec.Completions, oldSpec.Completions, fldPath)
}