From a647f9febbfba8ea7880e78b6e76b2ee1e08ab21 Mon Sep 17 00:00:00 2001 From: Daniel Vega-Myhre Date: Wed, 5 Jul 2023 18:47:45 +0000 Subject: [PATCH] default enabled pod index for test cases, add test case disabling it --- pkg/controller/job/job_controller_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index 94c2b35519f..4f47846c0ea 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -274,8 +274,8 @@ func TestControllerSyncJob(t *testing.T) { expectedPodPatches int // features - jobReadyPodsEnabled bool - podIndexLabelEnabled bool + jobReadyPodsEnabled bool + podIndexLabelDisabled bool }{ "job start": { parallelism: 2, @@ -782,7 +782,7 @@ func TestControllerSyncJob(t *testing.T) { expectedActive: 2, expectedPodPatches: 2, }, - "indexed job with podIndexLabel feature enabled": { + "indexed job with podIndexLabel feature disabled": { parallelism: 2, completions: 5, backoffLimit: 6, @@ -790,14 +790,14 @@ func TestControllerSyncJob(t *testing.T) { expectedCreations: 2, expectedActive: 2, expectedCreatedIndexes: sets.New(0, 1), - podIndexLabelEnabled: true, + podIndexLabelDisabled: true, }, } for name, tc := range testCases { t.Run(name, func(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.JobReadyPods, tc.jobReadyPodsEnabled)() - defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodIndexLabel, tc.podIndexLabelEnabled)() + defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodIndexLabel, !tc.podIndexLabelDisabled)() // job manager setup clientSet := clientset.NewForConfigOrDie(&restclient.Config{Host: "", ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}})