Merge pull request #18080 from wojtek-t/list_options_in_listwatch

Pass ListOptions to List in ListWatch.
This commit is contained in:
Wojciech Tyczynski
2015-12-09 14:27:51 +01:00
38 changed files with 105 additions and 101 deletions

View File

@@ -96,8 +96,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// Manage addition/update of daemon sets.
dsc.dsStore.Store, dsc.dsController = framework.NewInformer(
&cache.ListWatch{
ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(unversioned.ListOptions{})
ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) {
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(options)
},
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).Watch(options)
@@ -128,8 +128,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// more pods until all the effects (expectations) of a daemon set's create/delete have been observed.
dsc.podStore.Store, dsc.podController = framework.NewInformer(
&cache.ListWatch{
ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) {
return dsc.kubeClient.Pods(api.NamespaceAll).List(options)
},
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Pods(api.NamespaceAll).Watch(options)
@@ -146,8 +146,8 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
// Watch for new nodes or updates to nodes - daemon pods are launched on new nodes, and possibly when labels on nodes change,
dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer(
&cache.ListWatch{
ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Nodes().List(unversioned.ListOptions{})
ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) {
return dsc.kubeClient.Nodes().List(options)
},
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Nodes().Watch(options)