diff --git a/test/integration/cronjob/cronjob_test.go b/test/integration/cronjob/cronjob_test.go index f0f961ac9e8..4f663288dde 100644 --- a/test/integration/cronjob/cronjob_test.go +++ b/test/integration/cronjob/cronjob_test.go @@ -36,7 +36,7 @@ import ( "k8s.io/kubernetes/test/integration/framework" ) -func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *cronjob.Controller, *job.Controller, informers.SharedInformerFactory, clientset.Interface, restclient.Config) { +func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *cronjob.ControllerV2, *job.Controller, informers.SharedInformerFactory, clientset.Interface, restclient.Config) { controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAnAPIServer(controlPlaneConfig) @@ -47,7 +47,7 @@ func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *cronjob.Contro } resyncPeriod := 12 * time.Hour informerSet := informers.NewSharedInformerFactory(clientset.NewForConfigOrDie(restclient.AddUserAgent(&config, "cronjob-informers")), resyncPeriod) - cjc, err := cronjob.NewController(clientSet) + cjc, err := cronjob.NewControllerV2(informerSet.Batch().V1().Jobs(), informerSet.Batch().V1().CronJobs(), clientSet) if err != nil { t.Fatalf("Error creating CronJob controller: %v", err) } @@ -159,7 +159,7 @@ func TestCronJobLaunchesPodAndCleansUp(t *testing.T) { defer close(stopCh) informerSet.Start(stopCh) - go cjc.Run(stopCh) + go cjc.Run(1, stopCh) go jc.Run(1, stopCh) _, err := cjClient.Create(context.TODO(), newCronJob(cronJobName, ns.Name, "* * * * ?"), metav1.CreateOptions{})