Graduate ElasticIndexedJob to GA

This commit is contained in:
ahg-g
2024-06-27 06:17:32 +00:00
parent bffc02b955
commit be410c0dae
5 changed files with 7 additions and 72 deletions

View File

@@ -1609,22 +1609,6 @@ func TestValidateJobUpdate(t *testing.T) {
Field: "spec.completions",
},
},
"immutable completions for indexed job when AllowElasticIndexedJobs is false": {
old: batch.Job{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: batch.JobSpec{
Selector: validGeneratedSelector,
Template: validPodTemplateSpecForGenerated,
},
},
update: func(job *batch.Job) {
job.Spec.Completions = pointer.Int32(1)
},
err: &field.Error{
Type: field.ErrorTypeInvalid,
Field: "spec.completions",
},
},
"immutable selector": {
old: batch.Job{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
@@ -1930,7 +1914,7 @@ func TestValidateJobUpdate(t *testing.T) {
Field: "spec.completionMode",
},
},
"immutable completions for non-indexed job when AllowElasticIndexedJobs is true": {
"immutable completions for non-indexed job": {
old: batch.Job{
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: batch.JobSpec{
@@ -1947,7 +1931,6 @@ func TestValidateJobUpdate(t *testing.T) {
Type: field.ErrorTypeInvalid,
Field: "spec.completions",
},
opts: JobValidationOptions{AllowElasticIndexedJobs: true},
},
"immutable node affinity": {
@@ -2200,9 +2183,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = pointer.Int32(2)
job.Spec.Parallelism = pointer.Int32(2)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
},
"previous parallelism != previous completions, new parallelism == new completions": {
old: batch.Job{
@@ -2219,9 +2199,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = pointer.Int32(3)
job.Spec.Parallelism = pointer.Int32(3)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
},
"indexed job updating completions and parallelism to different values is invalid": {
old: batch.Job{
@@ -2238,9 +2215,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = pointer.Int32(2)
job.Spec.Parallelism = pointer.Int32(3)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
err: &field.Error{
Type: field.ErrorTypeInvalid,
Field: "spec.completions",
@@ -2261,9 +2235,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = nil
job.Spec.Parallelism = pointer.Int32(3)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
err: &field.Error{
Type: field.ErrorTypeRequired,
Field: "spec.completions",
@@ -2284,9 +2255,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = pointer.Int32(2)
job.Spec.Parallelism = pointer.Int32(1)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
},
"indexed job with completions unchanged, parallelism increased higher than completions": {
old: batch.Job{
@@ -2303,9 +2271,6 @@ func TestValidateJobUpdate(t *testing.T) {
job.Spec.Completions = pointer.Int32(2)
job.Spec.Parallelism = pointer.Int32(3)
},
opts: JobValidationOptions{
AllowElasticIndexedJobs: true,
},
},
}
ignoreValueAndDetail := cmpopts.IgnoreFields(field.Error{}, "BadValue", "Detail")