diff --git a/cmd/mpi-operator/main.go b/cmd/mpi-operator/main.go index 4d665252..589adf0a 100644 --- a/cmd/mpi-operator/main.go +++ b/cmd/mpi-operator/main.go @@ -72,7 +72,7 @@ func main() { } var pdbInformer policyinformers.PodDisruptionBudgetInformer - if !enableGangScheduling { + if enableGangScheduling { pdbInformer = kubeInformerFactory.Policy().V1beta1().PodDisruptionBudgets() } controller := controllers.NewMPIJobController( diff --git a/pkg/controllers/mpi_job_controller.go b/pkg/controllers/mpi_job_controller.go index 3b477f27..57540306 100644 --- a/pkg/controllers/mpi_job_controller.go +++ b/pkg/controllers/mpi_job_controller.go @@ -176,7 +176,7 @@ func NewMPIJobController( var pdbLister policylisters.PodDisruptionBudgetLister var pdbSynced cache.InformerSynced - if !enableGangScheduling { + if enableGangScheduling { pdbLister = pdbInformer.Lister() pdbSynced = pdbInformer.Informer().HasSynced } diff --git a/pkg/controllers/mpi_job_controller_test.go b/pkg/controllers/mpi_job_controller_test.go index e142b27c..0e37f748 100644 --- a/pkg/controllers/mpi_job_controller_test.go +++ b/pkg/controllers/mpi_job_controller_test.go @@ -150,7 +150,7 @@ func (f *fixture) newController(processingResourceType string, enableGangSchedul i := informers.NewSharedInformerFactory(f.client, noResyncPeriodFunc()) k8sI := kubeinformers.NewSharedInformerFactory(f.kubeClient, noResyncPeriodFunc()) var pdbInformer policyinformers.PodDisruptionBudgetInformer - if !enableGangScheduling { + if enableGangScheduling { pdbInformer = k8sI.Policy().V1beta1().PodDisruptionBudgets() } c := NewMPIJobController(