Unify per-resource List for unversioned client

This commit is contained in:
Wojciech Tyczynski
2015-10-13 12:11:48 +02:00
parent dfb400e2e9
commit 647aa1bc8c
34 changed files with 73 additions and 67 deletions

View File

@@ -30,7 +30,7 @@ type ReplicationControllersNamespacer interface {
// ReplicationControllerInterface has methods to work with ReplicationController resources.
type ReplicationControllerInterface interface {
List(selector labels.Selector) (*api.ReplicationControllerList, error)
List(label labels.Selector, field fields.Selector) (*api.ReplicationControllerList, error)
Get(name string) (*api.ReplicationController, error)
Create(ctrl *api.ReplicationController) (*api.ReplicationController, error)
Update(ctrl *api.ReplicationController) (*api.ReplicationController, error)
@@ -51,9 +51,9 @@ func newReplicationControllers(c *Client, namespace string) *replicationControll
}
// List takes a selector, and returns the list of replication controllers that match that selector.
func (c *replicationControllers) List(selector labels.Selector) (result *api.ReplicationControllerList, err error) {
func (c *replicationControllers) List(label labels.Selector, field fields.Selector) (result *api.ReplicationControllerList, err error) {
result = &api.ReplicationControllerList{}
err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").LabelsSelectorParam(selector).Do().Into(result)
err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return
}