Simplify List() signature in clients.
This commit is contained in:
@@ -31,7 +31,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@@ -64,7 +63,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
|
||||
e.serviceStore.Store, e.serviceController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Services(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Services(api.NamespaceAll).Watch(options)
|
||||
@@ -85,7 +84,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
|
||||
e.podStore.Store, e.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Pods(api.NamespaceAll).Watch(options)
|
||||
@@ -386,7 +385,7 @@ func (e *EndpointController) syncService(key string) {
|
||||
// some stragglers could have been left behind if the endpoint controller
|
||||
// reboots).
|
||||
func (e *EndpointController) checkLeftoverEndpoints() {
|
||||
list, err := e.client.Endpoints(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := e.client.Endpoints(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
glog.Errorf("Unable to list endpoints (%v); orphaned endpoints will not be cleaned up. (They're pretty harmless, but you can restart this component if you want another attempt made.)", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user