@@ -24,12 +24,12 @@ import (
2424 kubeclientset "k8s.io/client-go/kubernetes"
2525 "k8s.io/client-go/rest"
2626 "k8s.io/client-go/tools/record"
27- "k8s.io/kubernetes/pkg/controller"
2827 batchv1beta1 "volcano.sh/volcano/pkg/apis/scheduling/v1beta1"
2928 volcanoclient "volcano.sh/volcano/pkg/client/clientset/versioned"
3029
3130 commonv1 "github.com/kubeflow/common/pkg/apis/common/v1"
3231 "github.com/kubeflow/common/pkg/controller.v1/common"
32+ "github.com/kubeflow/common/pkg/controller.v1/control"
3333 "github.com/kubeflow/tf-operator/cmd/tf-operator.v1/app/options"
3434 tfv1 "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1"
3535 tfjobclientset "github.com/kubeflow/tf-operator/pkg/client/clientset/versioned"
@@ -62,7 +62,8 @@ func TestAddPod(t *testing.T) {
6262 },
6363 }
6464 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
65- ctr , _ , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
65+ ctr , _ , _ := newTFController (config , kubeClientSet ,
66+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
6667 ctr .tfJobInformerSynced = testutil .AlwaysReady
6768 ctr .PodInformerSynced = testutil .AlwaysReady
6869 ctr .ServiceInformerSynced = testutil .AlwaysReady
@@ -181,7 +182,8 @@ func TestClusterSpec(t *testing.T) {
181182 },
182183 }
183184 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
184- ctr , _ , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
185+ ctr , _ , _ := newTFController (config , kubeClientSet ,
186+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
185187 ctr .tfJobInformerSynced = testutil .AlwaysReady
186188 ctr .PodInformerSynced = testutil .AlwaysReady
187189 ctr .ServiceInformerSynced = testutil .AlwaysReady
@@ -340,8 +342,9 @@ func TestExitCode(t *testing.T) {
340342 },
341343 }
342344 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
343- ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
344- fakePodControl := & controller.FakePodControl {}
345+ ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet ,
346+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
347+ fakePodControl := & control.FakePodControl {}
345348 ctr .PodControl = fakePodControl
346349 ctr .tfJobInformerSynced = testutil .AlwaysReady
347350 ctr .PodInformerSynced = testutil .AlwaysReady
@@ -427,8 +430,9 @@ func TestScaleDown(t *testing.T) {
427430 },
428431 }
429432 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
430- ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
431- fakePodControl := & controller.FakePodControl {}
433+ ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet ,
434+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
435+ fakePodControl := & control.FakePodControl {}
432436 ctr .PodControl = fakePodControl
433437 ctr .Recorder = & record.FakeRecorder {}
434438 ctr .tfJobInformerSynced = testutil .AlwaysReady
@@ -510,8 +514,9 @@ func TestScaleUp(t *testing.T) {
510514 },
511515 }
512516 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
513- ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
514- fakePodControl := & controller.FakePodControl {}
517+ ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet ,
518+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
519+ fakePodControl := & control.FakePodControl {}
515520 ctr .PodControl = fakePodControl
516521 ctr .tfJobInformerSynced = testutil .AlwaysReady
517522 ctr .PodInformerSynced = testutil .AlwaysReady
@@ -671,7 +676,8 @@ func TestIsWorker0Completed(t *testing.T) {
671676 },
672677 }
673678 tfJobClientSet := tfjobclientset .NewForConfigOrDie (config )
674- ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet , volcanoClientSet , tfJobClientSet , controller .NoResyncPeriodFunc , options.ServerOption {})
679+ ctr , kubeInformerFactory , _ := newTFController (config , kubeClientSet ,
680+ volcanoClientSet , tfJobClientSet , 0 , options.ServerOption {})
675681 ctr .tfJobInformerSynced = testutil .AlwaysReady
676682 ctr .PodInformerSynced = testutil .AlwaysReady
677683 ctr .ServiceInformerSynced = testutil .AlwaysReady
0 commit comments