Skip to content

Commit

Permalink
pass stop channel to route-controller main goroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxuzhonghu committed Oct 19, 2017
1 parent d7e56d5 commit 152a0a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/route/route_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ type RouteController struct {
}

func New(routes cloudprovider.Routes, kubeClient clientset.Interface, nodeInformer coreinformers.NodeInformer, clusterName string, clusterCIDR *net.IPNet) *RouteController {
if kubeClient != nil && kubeClient.Core().RESTClient().GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("route_controller", kubeClient.Core().RESTClient().GetRateLimiter())
if kubeClient != nil && kubeClient.CoreV1().RESTClient().GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("route_controller", kubeClient.CoreV1().RESTClient().GetRateLimiter())
}

if clusterCIDR == nil {
Expand Down Expand Up @@ -114,7 +114,7 @@ func (rc *RouteController) Run(stopCh <-chan struct{}, syncPeriod time.Duration)
if err := rc.reconcileNodeRoutes(); err != nil {
glog.Errorf("Couldn't reconcile node routes: %v", err)
}
}, syncPeriod, wait.NeverStop)
}, syncPeriod, stopCh)

<-stopCh
}
Expand Down Expand Up @@ -254,7 +254,7 @@ func (rc *RouteController) updateNetworkingCondition(nodeName types.NodeName, ro
glog.Errorf("Error updating node %s: %v", nodeName, err)
return err
}
glog.Errorf("Error updating node %s, retrying: %v", nodeName, err)
glog.V(4).Infof("Error updating node %s, retrying: %v", nodeName, err)
}
glog.Errorf("Error updating node %s: %v", nodeName, err)
return err
Expand Down

0 comments on commit 152a0a8

Please sign in to comment.