Simplify List() signature in clients.

This commit is contained in:
Wojciech Tyczynski
2015-12-02 12:12:57 +01:00
parent 800012dfb8
commit 6dcb689d4e
141 changed files with 532 additions and 650 deletions

View File

@@ -21,8 +21,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch"
)
@@ -33,7 +31,7 @@ type NodesInterface interface {
type NodeInterface interface {
Get(name string) (result *api.Node, err error)
Create(node *api.Node) (*api.Node, error)
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error)
List(opts unversioned.ListOptions) (*api.NodeList, error)
Delete(name string) error
Update(*api.Node) (*api.Node, error)
UpdateStatus(*api.Node) (*api.Node, error)
@@ -63,9 +61,9 @@ func (c *nodes) Create(node *api.Node) (*api.Node, error) {
}
// List takes a selector, and returns the list of nodes that match that selector in the cluster.
func (c *nodes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
func (c *nodes) List(opts unversioned.ListOptions) (*api.NodeList, error) {
result := &api.NodeList{}
err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).Do().Into(result)
return result, err
}