GCE: Revert node handlers removal

This commit is contained in:
Manuel de Brito Fontes 2017-07-26 21:46:52 -04:00
parent 16a213c076
commit 11c0306937

View file

@ -170,11 +170,17 @@ func NewLoadBalancerController(kubeClient kubernetes.Interface, clusterManager *
) )
// Node watch handlers // Node watch handlers
nodeHandlers := cache.ResourceEventHandlerFuncs{
AddFunc: lbc.nodeQueue.enqueue,
DeleteFunc: lbc.nodeQueue.enqueue,
// Nodes are updated every 10s and we don't care, so no update handler.
}
lbc.nodeLister.Indexer, lbc.nodeController = cache.NewIndexerInformer( lbc.nodeLister.Indexer, lbc.nodeController = cache.NewIndexerInformer(
cache.NewListWatchFromClient(lbc.client.Core().RESTClient(), "nodes", api_v1.NamespaceAll, fields.Everything()), cache.NewListWatchFromClient(lbc.client.Core().RESTClient(), "nodes", api_v1.NamespaceAll, fields.Everything()),
&api_v1.Node{}, &api_v1.Node{},
resyncPeriod, resyncPeriod,
cache.ResourceEventHandlerFuncs{}, nodeHandlers,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
) )