Commit 8780b45a authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #29369 from ping035627/ping035627-patch-0721

Automatic merge from submit-queue two optimization for StartControllers in controllermanager.go The PR changed two places to optimise StartControllers function in controllermanager.go.
parents f4de2c4e eb2f6934
...@@ -265,10 +265,8 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig ...@@ -265,10 +265,8 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
routeController.Run(s.NodeSyncPeriod.Duration) routeController.Run(s.NodeSyncPeriod.Duration)
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
} }
} else if s.ConfigureCloudRoutes && !s.AllocateNodeCIDRs { } else {
glog.Warningf("allocate-node-cidrs set to %v, will not configure cloud provider routes.", s.AllocateNodeCIDRs) glog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", s.AllocateNodeCIDRs, s.ConfigureCloudRoutes)
} else if s.AllocateNodeCIDRs && !s.ConfigureCloudRoutes {
glog.Infof("configure-cloud-routes is set to %v, will not configure cloud provider routes.", s.ConfigureCloudRoutes)
} }
resourceQuotaControllerClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "resourcequota-controller")) resourceQuotaControllerClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "resourcequota-controller"))
...@@ -419,10 +417,9 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig ...@@ -419,10 +417,9 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
ProbeAttachableVolumePlugins(s.VolumeConfiguration)) ProbeAttachableVolumePlugins(s.VolumeConfiguration))
if attachDetachControllerErr != nil { if attachDetachControllerErr != nil {
glog.Fatalf("Failed to start attach/detach controller: %v", attachDetachControllerErr) glog.Fatalf("Failed to start attach/detach controller: %v", attachDetachControllerErr)
} else { }
go attachDetachController.Run(wait.NeverStop) go attachDetachController.Run(wait.NeverStop)
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
}
groupVersion = "certificates/v1alpha1" groupVersion = "certificates/v1alpha1"
resources, found = resourceMap[groupVersion] resources, found = resourceMap[groupVersion]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment