add namespace index to rc and pod

This commit is contained in:
mqliang
2016-04-07 20:15:21 +08:00
parent 7e462c2310
commit 9011207f18
25 changed files with 263 additions and 168 deletions

View File

@@ -144,7 +144,7 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller
},
)
dc.podStore.Store, dc.podController = framework.NewInformer(
dc.podStore.Indexer, dc.podController = framework.NewIndexerInformer(
&cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
return dc.client.Core().Pods(api.NamespaceAll).List(options)
@@ -160,6 +160,7 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller
UpdateFunc: dc.updatePod,
DeleteFunc: dc.deletePod,
},
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
)
dc.syncHandler = dc.syncDeployment