Skip to content

Commit

Permalink
fixbug
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Nov 6, 2019
1 parent d23bfd0 commit 8fecc00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func main() {
glog.Fatalf("failed to get advanced-statefulset Clientset: %v", err)
}

if features.DefaultFeatureGate.Enabled(features.AdvancedStatefulSet) {
// If AdvancedStatefulSet is enabled, we hijack the Kubernetes client to use
// AdvancedStatefulSet.
kubeCli = helper.NewHijackClient(kubeCli, asCli)
}

var informerFactory informers.SharedInformerFactory
var kubeInformerFactory kubeinformers.SharedInformerFactory
if controller.ClusterScoped {
Expand Down Expand Up @@ -144,12 +150,6 @@ func main() {
},
}

if features.DefaultFeatureGate.Enabled(features.AdvancedStatefulSet) {
// If AdvancedStatefulSet is enabled, we hijack the Kubernetes client to use
// AdvancedStatefulSet.
kubeCli = helper.NewHijackClient(kubeCli, asCli)
}

tcController := tidbcluster.NewController(kubeCli, cli, informerFactory, kubeInformerFactory, autoFailover, pdFailoverPeriod, tikvFailoverPeriod, tidbFailoverPeriod)
backupController := backup.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
restoreController := restore.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
Expand Down

0 comments on commit 8fecc00

Please sign in to comment.