Merge pull request #13076 from invenfantasy/master

Cleanup deprecated Forever function
This commit is contained in:
Yu-Ju Hong
2015-08-25 10:07:10 -07:00
18 changed files with 37 additions and 42 deletions

View File

@@ -53,11 +53,11 @@ func New(client *client.Client, expClient client.ExperimentalInterface) *Horizon
}
func (a *HorizontalPodAutoscalerController) Run(syncPeriod time.Duration) {
go util.Forever(func() {
go util.Until(func() {
if err := a.reconcileAutoscalers(); err != nil {
glog.Errorf("Couldn't reconcile horizontal pod autoscalers: %v", err)
}
}, syncPeriod)
}, syncPeriod, util.NeverStop)
}
func (a *HorizontalPodAutoscalerController) reconcileAutoscalers() error {

View File

@@ -138,15 +138,15 @@ func NewNodeController(
// Run starts an asynchronous loop that monitors the status of cluster nodes.
func (nc *NodeController) Run(period time.Duration) {
// Incorporate the results of node status pushed from kubelet to master.
go util.Forever(func() {
go util.Until(func() {
if err := nc.monitorNodeStatus(); err != nil {
glog.Errorf("Error monitoring node status: %v", err)
}
}, nc.nodeMonitorPeriod)
}, nc.nodeMonitorPeriod, util.NeverStop)
go util.Forever(func() {
go util.Until(func() {
nc.podEvictor.TryEvict(func(nodeName string) { nc.deletePods(nodeName) })
}, nodeEvictionPeriod)
}, nodeEvictionPeriod, util.NeverStop)
}
// We observed a Node deletion in etcd. Currently we only need to remove Pods that

View File

@@ -52,7 +52,7 @@ func NewResourceQuotaController(kubeClient client.Interface) *ResourceQuotaContr
// Run begins watching and syncing.
func (rm *ResourceQuotaController) Run(period time.Duration) {
rm.syncTime = time.Tick(period)
go util.Forever(func() { rm.synchronize() }, period)
go util.Until(func() { rm.synchronize() }, period, util.NeverStop)
}
func (rm *ResourceQuotaController) synchronize() {

View File

@@ -47,11 +47,11 @@ func New(routes cloudprovider.Routes, kubeClient client.Interface, clusterName s
}
func (rc *RouteController) Run(syncPeriod time.Duration) {
go util.Forever(func() {
go util.Until(func() {
if err := rc.reconcileNodeRoutes(); err != nil {
glog.Errorf("Couldn't reconcile node routes: %v", err)
}
}, syncPeriod)
}, syncPeriod, util.NeverStop)
}
func (rc *RouteController) reconcileNodeRoutes() error {