Merge pull request #17832 from wojtek-t/list_options_in_list

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-12-02 02:34:17 -08:00
138 changed files with 376 additions and 308 deletions

View File

@@ -305,7 +305,7 @@ func makeTempDirOrDie(prefix string, baseDir string) string {
func podsOnNodes(c *client.Client, podNamespace string, labelSelector labels.Selector) wait.ConditionFunc { func podsOnNodes(c *client.Client, podNamespace string, labelSelector labels.Selector) wait.ConditionFunc {
// Wait until all pods are running on the node. // Wait until all pods are running on the node.
return func() (bool, error) { return func() (bool, error) {
pods, err := c.Pods(podNamespace).List(labelSelector, fields.Everything()) pods, err := c.Pods(podNamespace).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
glog.Infof("Unable to get pods to list: %v", err) glog.Infof("Unable to get pods to list: %v", err)
return false, nil return false, nil
@@ -431,7 +431,7 @@ containers:
namespace := kubetypes.NamespaceDefault namespace := kubetypes.NamespaceDefault
if err := wait.Poll(time.Second, longTestTimeout, if err := wait.Poll(time.Second, longTestTimeout,
podRunning(c, namespace, podName)); err != nil { podRunning(c, namespace, podName)); err != nil {
if pods, err := c.Pods(namespace).List(labels.Everything(), fields.Everything()); err == nil { if pods, err := c.Pods(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}); err == nil {
for _, pod := range pods.Items { for _, pod := range pods.Items {
glog.Infof("pod found: %s/%s", namespace, pod.Name) glog.Infof("pod found: %s/%s", namespace, pod.Name)
} }
@@ -539,7 +539,7 @@ func runSelfLinkTestOnNamespace(c *client.Client, namespace string) {
glog.Fatalf("Failed listing service with supplied self link '%v': %v", svc.SelfLink, err) glog.Fatalf("Failed listing service with supplied self link '%v': %v", svc.SelfLink, err)
} }
svcList, err := services.List(labels.Everything(), fields.Everything()) svcList, err := services.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
glog.Fatalf("Failed listing services: %v", err) glog.Fatalf("Failed listing services: %v", err)
} }
@@ -760,7 +760,7 @@ func runPatchTest(c *client.Client) {
func runMasterServiceTest(client *client.Client) { func runMasterServiceTest(client *client.Client) {
time.Sleep(12 * time.Second) time.Sleep(12 * time.Second)
svcList, err := client.Services(api.NamespaceDefault).List(labels.Everything(), fields.Everything()) svcList, err := client.Services(api.NamespaceDefault).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
glog.Fatalf("Unexpected error listing services: %v", err) glog.Fatalf("Unexpected error listing services: %v", err)
} }
@@ -887,7 +887,7 @@ func runServiceTest(client *client.Client) {
glog.Fatalf("FAILED: service in other namespace should have no endpoints: %v", err) glog.Fatalf("FAILED: service in other namespace should have no endpoints: %v", err)
} }
svcList, err := client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything()) svcList, err := client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
glog.Fatalf("Failed to list services across namespaces: %v", err) glog.Fatalf("Failed to list services across namespaces: %v", err)
} }

View File

@@ -43,6 +43,7 @@ import (
"k8s.io/kubernetes/contrib/mesos/pkg/scheduler/podtask" "k8s.io/kubernetes/contrib/mesos/pkg/scheduler/podtask"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/container"
@@ -647,7 +648,7 @@ func (k *framework) makeTaskRegistryReconciler() taskreconciler.Action {
// tasks identified by annotations in the Kubernetes pod registry. // tasks identified by annotations in the Kubernetes pod registry.
func (k *framework) makePodRegistryReconciler() taskreconciler.Action { func (k *framework) makePodRegistryReconciler() taskreconciler.Action {
return taskreconciler.Action(func(drv bindings.SchedulerDriver, cancel <-chan struct{}) <-chan error { return taskreconciler.Action(func(drv bindings.SchedulerDriver, cancel <-chan struct{}) <-chan error {
podList, err := k.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) podList, err := k.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return proc.ErrorChanf("failed to reconcile pod registry: %v", err) return proc.ErrorChanf("failed to reconcile pod registry: %v", err)
} }
@@ -723,7 +724,7 @@ func (k *framework) explicitlyReconcileTasks(driver bindings.SchedulerDriver, ta
} }
func (ks *framework) recoverTasks() error { func (ks *framework) recoverTasks() error {
podList, err := ks.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) podList, err := ks.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
log.V(1).Infof("failed to recover pod registry, madness may ensue: %v", err) log.V(1).Infof("failed to recover pod registry, madness may ensue: %v", err)
return err return err

View File

@@ -60,7 +60,7 @@ func NewEndpointController(client *client.Client) *endpointController {
e.serviceStore.Store, e.serviceController = framework.NewInformer( e.serviceStore.Store, e.serviceController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return e.client.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -80,7 +80,7 @@ func NewEndpointController(client *client.Client) *endpointController {
e.podStore.Store, e.podController = framework.NewInformer( e.podStore.Store, e.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return e.client.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -386,7 +386,7 @@ func (e *endpointController) syncService(key string) {
// some stragglers could have been left behind if the endpoint controller // some stragglers could have been left behind if the endpoint controller
// reboots). // reboots).
func (e *endpointController) checkLeftoverEndpoints() { func (e *endpointController) checkLeftoverEndpoints() {
list, err := e.client.Endpoints(api.NamespaceAll).List(labels.Everything(), fields.Everything()) list, err := e.client.Endpoints(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { 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) 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 return

View File

@@ -31,7 +31,7 @@ type DaemonSetsNamespacer interface {
} }
type DaemonSetInterface interface { type DaemonSetInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.DaemonSetList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DaemonSetList, error)
Get(name string) (*extensions.DaemonSet, error) Get(name string) (*extensions.DaemonSet, error)
Create(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) Create(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
@@ -53,9 +53,9 @@ func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
// Ensure statically that daemonSets implements DaemonSetsInterface. // Ensure statically that daemonSets implements DaemonSetsInterface.
var _ DaemonSetInterface = &daemonSets{} var _ DaemonSetInterface = &daemonSets{}
func (c *daemonSets) List(label labels.Selector, field fields.Selector) (result *extensions.DaemonSetList, err error) { func (c *daemonSets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.DaemonSetList, err error) {
result = &extensions.DaemonSetList{} result = &extensions.DaemonSetList{}
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("daemonsets").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -56,7 +57,7 @@ func TestListDaemonSets(t *testing.T) {
}, },
}, },
} }
receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(labels.Everything(), fields.Everything()) receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedDSs, err) c.Validate(t, receivedDSs, err)
} }

View File

@@ -32,7 +32,7 @@ type DeploymentsNamespacer interface {
// DeploymentInterface has methods to work with Deployment resources. // DeploymentInterface has methods to work with Deployment resources.
type DeploymentInterface interface { type DeploymentInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.DeploymentList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DeploymentList, error)
Get(name string) (*extensions.Deployment, error) Get(name string) (*extensions.Deployment, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(*extensions.Deployment) (*extensions.Deployment, error) Create(*extensions.Deployment) (*extensions.Deployment, error)
@@ -56,9 +56,9 @@ func newDeployments(c *ExtensionsClient, namespace string) *deployments {
} }
// List takes label and field selectors, and returns the list of Deployments that match those selectors. // List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(label labels.Selector, field fields.Selector) (result *extensions.DeploymentList, err error) { func (c *deployments) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.DeploymentList, err error) {
result = &extensions.DeploymentList{} result = &extensions.DeploymentList{}
err = c.client.Get().Namespace(c.ns).Resource("deployments").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("deployments").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -100,7 +100,7 @@ func TestDeploymentList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: deploymentList}, Response: Response{StatusCode: 200, Body: deploymentList},
} }
response, err := c.Setup(t).Deployments(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).Deployments(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -34,7 +34,7 @@ type EndpointsNamespacer interface {
// EndpointsInterface has methods to work with Endpoints resources // EndpointsInterface has methods to work with Endpoints resources
type EndpointsInterface interface { type EndpointsInterface interface {
Create(endpoints *api.Endpoints) (*api.Endpoints, error) Create(endpoints *api.Endpoints) (*api.Endpoints, error)
List(label labels.Selector, field fields.Selector) (*api.EndpointsList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EndpointsList, error)
Get(name string) (*api.Endpoints, error) Get(name string) (*api.Endpoints, error)
Delete(name string) error Delete(name string) error
Update(endpoints *api.Endpoints) (*api.Endpoints, error) Update(endpoints *api.Endpoints) (*api.Endpoints, error)
@@ -60,11 +60,12 @@ func (c *endpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error) {
} }
// List takes a selector, and returns the list of endpoints that match that selector // List takes a selector, and returns the list of endpoints that match that selector
func (c *endpoints) List(label labels.Selector, field fields.Selector) (result *api.EndpointsList, err error) { func (c *endpoints) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.EndpointsList, err error) {
result = &api.EndpointsList{} result = &api.EndpointsList{}
err = c.r.Get(). err = c.r.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("endpoints"). Resource("endpoints").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
@@ -43,7 +44,7 @@ func TestListEndpoints(t *testing.T) {
}, },
}, },
} }
receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(labels.Everything(), fields.Everything()) receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedEndpointsList, err) c.Validate(t, receivedEndpointsList, err)
} }

View File

@@ -37,7 +37,7 @@ type EventInterface interface {
Create(event *api.Event) (*api.Event, error) Create(event *api.Event) (*api.Event, error)
Update(event *api.Event) (*api.Event, error) Update(event *api.Event) (*api.Event, error)
Patch(event *api.Event, data []byte) (*api.Event, error) Patch(event *api.Event, data []byte) (*api.Event, error)
List(label labels.Selector, field fields.Selector) (*api.EventList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error)
Get(name string) (*api.Event, error) Get(name string) (*api.Event, error)
Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error)
// Search finds events about the specified object // Search finds events about the specified object
@@ -117,11 +117,12 @@ func (e *events) Patch(incompleteEvent *api.Event, data []byte) (*api.Event, err
} }
// List returns a list of events matching the selectors. // List returns a list of events matching the selectors.
func (e *events) List(label labels.Selector, field fields.Selector) (*api.EventList, error) { func (e *events) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error) {
result := &api.EventList{} result := &api.EventList{}
err := e.client.Get(). err := e.client.Get().
NamespaceIfScoped(e.namespace, len(e.namespace) > 0). NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
Resource("events"). Resource("events").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().
@@ -175,7 +176,7 @@ func (e *events) Search(objOrRef runtime.Object) (*api.EventList, error) {
refUID = &stringRefUID refUID = &stringRefUID
} }
fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID)
return e.List(labels.Everything(), fieldSelector) return e.List(labels.Everything(), fieldSelector, unversioned.ListOptions{})
} }
// Delete deletes an existing event. // Delete deletes an existing event.

View File

@@ -167,7 +167,7 @@ func TestEventList(t *testing.T) {
Response: Response{StatusCode: 200, Body: eventList}, Response: Response{StatusCode: 200, Body: eventList},
} }
response, err := c.Setup(t).Events(ns).List(labels.Everything(), response, err := c.Setup(t).Events(ns).List(labels.Everything(),
fields.Everything()) fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
t.Errorf("%#v should be nil.", err) t.Errorf("%#v should be nil.", err)

View File

@@ -32,7 +32,7 @@ type HorizontalPodAutoscalersNamespacer interface {
// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources.
type HorizontalPodAutoscalerInterface interface { type HorizontalPodAutoscalerInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.HorizontalPodAutoscalerList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error)
Get(name string) (*extensions.HorizontalPodAutoscaler, error) Get(name string) (*extensions.HorizontalPodAutoscaler, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
@@ -56,9 +56,9 @@ func newHorizontalPodAutoscalers(c *ExtensionsClient, namespace string) *horizon
} }
// List takes label and field selectors, and returns the list of horizontalPodAutoscalers that match those selectors. // List takes label and field selectors, and returns the list of horizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (result *extensions.HorizontalPodAutoscalerList, err error) { func (c *horizontalPodAutoscalers) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.HorizontalPodAutoscalerList, err error) {
result = &extensions.HorizontalPodAutoscalerList{} result = &extensions.HorizontalPodAutoscalerList{}
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -100,7 +100,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: horizontalPodAutoscalerList}, Response: Response{StatusCode: 200, Body: horizontalPodAutoscalerList},
} }
response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -32,7 +32,7 @@ type IngressNamespacer interface {
// IngressInterface exposes methods to work on Ingress resources. // IngressInterface exposes methods to work on Ingress resources.
type IngressInterface interface { type IngressInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.IngressList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.IngressList, error)
Get(name string) (*extensions.Ingress, error) Get(name string) (*extensions.Ingress, error)
Create(ingress *extensions.Ingress) (*extensions.Ingress, error) Create(ingress *extensions.Ingress) (*extensions.Ingress, error)
Update(ingress *extensions.Ingress) (*extensions.Ingress, error) Update(ingress *extensions.Ingress) (*extensions.Ingress, error)
@@ -53,9 +53,9 @@ func newIngress(c *ExtensionsClient, namespace string) *ingress {
} }
// List returns a list of ingress that match the label and field selectors. // List returns a list of ingress that match the label and field selectors.
func (c *ingress) List(label labels.Selector, field fields.Selector) (result *extensions.IngressList, err error) { func (c *ingress) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.IngressList, err error) {
result = &extensions.IngressList{} result = &extensions.IngressList{}
err = c.r.Get().Namespace(c.ns).Resource("ingresses").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("ingresses").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -56,7 +57,7 @@ func TestListIngress(t *testing.T) {
}, },
}, },
} }
receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(labels.Everything(), fields.Everything()) receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedIngressList, err) c.Validate(t, receivedIngressList, err)
} }

View File

@@ -33,7 +33,7 @@ type JobsNamespacer interface {
// JobInterface exposes methods to work on Job resources. // JobInterface exposes methods to work on Job resources.
type JobInterface interface { type JobInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.JobList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.JobList, error)
Get(name string) (*extensions.Job, error) Get(name string) (*extensions.Job, error)
Create(job *extensions.Job) (*extensions.Job, error) Create(job *extensions.Job) (*extensions.Job, error)
Update(job *extensions.Job) (*extensions.Job, error) Update(job *extensions.Job) (*extensions.Job, error)
@@ -57,9 +57,9 @@ func newJobs(c *ExtensionsClient, namespace string) *jobs {
var _ JobInterface = &jobs{} var _ JobInterface = &jobs{}
// List returns a list of jobs that match the label and field selectors. // List returns a list of jobs that match the label and field selectors.
func (c *jobs) List(label labels.Selector, field fields.Selector) (result *extensions.JobList, err error) { func (c *jobs) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.JobList, err error) {
result = &extensions.JobList{} result = &extensions.JobList{}
err = c.r.Get().Namespace(c.ns).Resource("jobs").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("jobs").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -56,7 +57,7 @@ func TestListJobs(t *testing.T) {
}, },
}, },
} }
receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(labels.Everything(), fields.Everything()) receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedJobList, err) c.Validate(t, receivedJobList, err)
} }

View File

@@ -33,7 +33,7 @@ type LimitRangesNamespacer interface {
// LimitRangeInterface has methods to work with LimitRange resources. // LimitRangeInterface has methods to work with LimitRange resources.
type LimitRangeInterface interface { type LimitRangeInterface interface {
List(label labels.Selector, field fields.Selector) (*api.LimitRangeList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.LimitRangeList, error)
Get(name string) (*api.LimitRange, error) Get(name string) (*api.LimitRange, error)
Delete(name string) error Delete(name string) error
Create(limitRange *api.LimitRange) (*api.LimitRange, error) Create(limitRange *api.LimitRange) (*api.LimitRange, error)
@@ -56,9 +56,9 @@ func newLimitRanges(c *Client, namespace string) *limitRanges {
} }
// List takes a selector, and returns the list of limitRanges that match that selector. // List takes a selector, and returns the list of limitRanges that match that selector.
func (c *limitRanges) List(label labels.Selector, field fields.Selector) (result *api.LimitRangeList, err error) { func (c *limitRanges) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.LimitRangeList, err error) {
result = &api.LimitRangeList{} result = &api.LimitRangeList{}
err = c.r.Get().Namespace(c.ns).Resource("limitRanges").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("limitRanges").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -123,7 +123,7 @@ func TestLimitRangeList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: limitRangeList}, Response: Response{StatusCode: 200, Body: limitRangeList},
} }
response, err := c.Setup(t).LimitRanges(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).LimitRanges(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -33,7 +33,7 @@ type NamespacesInterface interface {
type NamespaceInterface interface { type NamespaceInterface interface {
Create(item *api.Namespace) (*api.Namespace, error) Create(item *api.Namespace) (*api.Namespace, error)
Get(name string) (result *api.Namespace, err error) Get(name string) (result *api.Namespace, err error)
List(label labels.Selector, field fields.Selector) (*api.NamespaceList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error)
Delete(name string) error Delete(name string) error
Update(item *api.Namespace) (*api.Namespace, error) Update(item *api.Namespace) (*api.Namespace, error)
Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error)
@@ -59,10 +59,11 @@ func (c *namespaces) Create(namespace *api.Namespace) (*api.Namespace, error) {
} }
// List lists all the namespaces in the cluster. // List lists all the namespaces in the cluster.
func (c *namespaces) List(label labels.Selector, field fields.Selector) (*api.NamespaceList, error) { func (c *namespaces) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error) {
result := &api.NamespaceList{} result := &api.NamespaceList{}
err := c.r.Get(). err := c.r.Get().
Resource("namespaces"). Resource("namespaces").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do().Into(result) Do().Into(result)

View File

@@ -93,7 +93,7 @@ func TestNamespaceList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: namespaceList}, Response: Response{StatusCode: 200, Body: namespaceList},
} }
response, err := c.Setup(t).Namespaces().List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
t.Errorf("%#v should be nil.", err) t.Errorf("%#v should be nil.", err)

View File

@@ -33,7 +33,7 @@ type NodesInterface interface {
type NodeInterface interface { type NodeInterface interface {
Get(name string) (result *api.Node, err error) Get(name string) (result *api.Node, err error)
Create(node *api.Node) (*api.Node, error) Create(node *api.Node) (*api.Node, error)
List(label labels.Selector, field fields.Selector) (*api.NodeList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error)
Delete(name string) error Delete(name string) error
Update(*api.Node) (*api.Node, error) Update(*api.Node) (*api.Node, error)
UpdateStatus(*api.Node) (*api.Node, error) UpdateStatus(*api.Node) (*api.Node, error)
@@ -63,9 +63,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. // 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) (*api.NodeList, error) { func (c *nodes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
result := &api.NodeList{} result := &api.NodeList{}
err := c.r.Get().Resource(c.resourceName()).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return result, err return result, err
} }

View File

@@ -40,7 +40,7 @@ func TestListNodes(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: &api.NodeList{ListMeta: unversioned.ListMeta{ResourceVersion: "1"}}}, Response: Response{StatusCode: 200, Body: &api.NodeList{ListMeta: unversioned.ListMeta{ResourceVersion: "1"}}},
} }
response, err := c.Setup(t).Nodes().List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }
@@ -70,7 +70,7 @@ func TestListNodesLabels(t *testing.T) {
c.Setup(t) c.Setup(t)
c.QueryValidator[labelSelectorQueryParamName] = validateLabels c.QueryValidator[labelSelectorQueryParamName] = validateLabels
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
receivedNodeList, err := c.Nodes().List(selector, fields.Everything()) receivedNodeList, err := c.Nodes().List(selector, fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedNodeList, err) c.Validate(t, receivedNodeList, err)
} }

View File

@@ -107,7 +107,7 @@ func TestPersistentVolumeList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: persistentVolumeList}, Response: Response{StatusCode: 200, Body: persistentVolumeList},
} }
response, err := c.Setup(t).PersistentVolumes().List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -33,7 +33,7 @@ type PersistentVolumeClaimsNamespacer interface {
// PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. // PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources.
type PersistentVolumeClaimInterface interface { type PersistentVolumeClaimInterface interface {
List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeClaimList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error)
Get(name string) (*api.PersistentVolumeClaim, error) Get(name string) (*api.PersistentVolumeClaim, error)
Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
@@ -53,12 +53,13 @@ func newPersistentVolumeClaims(c *Client, namespace string) *persistentVolumeCla
return &persistentVolumeClaims{c, namespace} return &persistentVolumeClaims{c, namespace}
} }
func (c *persistentVolumeClaims) List(label labels.Selector, field fields.Selector) (result *api.PersistentVolumeClaimList, err error) { func (c *persistentVolumeClaims) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PersistentVolumeClaimList, err error) {
result = &api.PersistentVolumeClaimList{} result = &api.PersistentVolumeClaimList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.namespace). Namespace(c.namespace).
Resource("persistentVolumeClaims"). Resource("persistentVolumeClaims").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -116,7 +116,7 @@ func TestPersistentVolumeClaimList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: persistentVolumeList}, Response: Response{StatusCode: 200, Body: persistentVolumeList},
} }
response, err := c.Setup(t).PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -32,7 +32,7 @@ type PersistentVolumesInterface interface {
// PersistentVolumeInterface has methods to work with PersistentVolume resources. // PersistentVolumeInterface has methods to work with PersistentVolume resources.
type PersistentVolumeInterface interface { type PersistentVolumeInterface interface {
List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeList, error)
Get(name string) (*api.PersistentVolume, error) Get(name string) (*api.PersistentVolume, error)
Create(volume *api.PersistentVolume) (*api.PersistentVolume, error) Create(volume *api.PersistentVolume) (*api.PersistentVolume, error)
Update(volume *api.PersistentVolume) (*api.PersistentVolume, error) Update(volume *api.PersistentVolume) (*api.PersistentVolume, error)
@@ -50,10 +50,11 @@ func newPersistentVolumes(c *Client) *persistentVolumes {
return &persistentVolumes{c} return &persistentVolumes{c}
} }
func (c *persistentVolumes) List(label labels.Selector, field fields.Selector) (result *api.PersistentVolumeList, err error) { func (c *persistentVolumes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PersistentVolumeList, err error) {
result = &api.PersistentVolumeList{} result = &api.PersistentVolumeList{}
err = c.client.Get(). err = c.client.Get().
Resource("persistentVolumes"). Resource("persistentVolumes").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -31,7 +31,7 @@ type PodTemplatesNamespacer interface {
// PodTemplateInterface has methods to work with PodTemplate resources. // PodTemplateInterface has methods to work with PodTemplate resources.
type PodTemplateInterface interface { type PodTemplateInterface interface {
List(label labels.Selector, field fields.Selector) (*api.PodTemplateList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodTemplateList, error)
Get(name string) (*api.PodTemplate, error) Get(name string) (*api.PodTemplate, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(podTemplate *api.PodTemplate) (*api.PodTemplate, error) Create(podTemplate *api.PodTemplate) (*api.PodTemplate, error)
@@ -54,9 +54,9 @@ func newPodTemplates(c *Client, namespace string) *podTemplates {
} }
// List takes label and field selectors, and returns the list of podTemplates that match those selectors. // List takes label and field selectors, and returns the list of podTemplates that match those selectors.
func (c *podTemplates) List(label labels.Selector, field fields.Selector) (result *api.PodTemplateList, err error) { func (c *podTemplates) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PodTemplateList, err error) {
result = &api.PodTemplateList{} result = &api.PodTemplateList{}
err = c.r.Get().Namespace(c.ns).Resource("podTemplates").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("podTemplates").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -98,7 +98,7 @@ func TestPodTemplateList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: podTemplateList}, Response: Response{StatusCode: 200, Body: podTemplateList},
} }
response, err := c.Setup(t).PodTemplates(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).PodTemplates(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -31,7 +31,7 @@ type PodsNamespacer interface {
// PodInterface has methods to work with Pod resources. // PodInterface has methods to work with Pod resources.
type PodInterface interface { type PodInterface interface {
List(label labels.Selector, field fields.Selector) (*api.PodList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodList, error)
Get(name string) (*api.Pod, error) Get(name string) (*api.Pod, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(pod *api.Pod) (*api.Pod, error) Create(pod *api.Pod) (*api.Pod, error)
@@ -57,9 +57,9 @@ func newPods(c *Client, namespace string) *pods {
} }
// List takes label and field selectors, and returns the list of pods that match those selectors. // List takes label and field selectors, and returns the list of pods that match those selectors.
func (c *pods) List(label labels.Selector, field fields.Selector) (result *api.PodList, err error) { func (c *pods) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PodList, err error) {
result = &api.PodList{} result = &api.PodList{}
err = c.r.Get().Namespace(c.ns).Resource("pods").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("pods").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -34,7 +34,7 @@ func TestListEmptyPods(t *testing.T) {
Request: testRequest{Method: "GET", Path: testapi.Default.ResourcePath("pods", ns, ""), Query: buildQueryValues(nil)}, Request: testRequest{Method: "GET", Path: testapi.Default.ResourcePath("pods", ns, ""), Query: buildQueryValues(nil)},
Response: Response{StatusCode: http.StatusOK, Body: &api.PodList{}}, Response: Response{StatusCode: http.StatusOK, Body: &api.PodList{}},
} }
podList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything()) podList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, podList, err) c.Validate(t, podList, err)
} }
@@ -60,7 +60,7 @@ func TestListPods(t *testing.T) {
}, },
}, },
} }
receivedPodList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything()) receivedPodList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedPodList, err) c.Validate(t, receivedPodList, err)
} }
@@ -94,7 +94,7 @@ func TestListPodsLabels(t *testing.T) {
c.Setup(t) c.Setup(t)
c.QueryValidator[labelSelectorQueryParamName] = validateLabels c.QueryValidator[labelSelectorQueryParamName] = validateLabels
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
receivedPodList, err := c.Pods(ns).List(selector, fields.Everything()) receivedPodList, err := c.Pods(ns).List(selector, fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedPodList, err) c.Validate(t, receivedPodList, err)
} }

View File

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

View File

@@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
@@ -56,7 +57,7 @@ func TestListControllers(t *testing.T) {
}, },
}, },
} }
receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(labels.Everything(), fields.Everything()) receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedControllerList, err) c.Validate(t, receivedControllerList, err)
} }

View File

@@ -31,7 +31,7 @@ type ResourceQuotasNamespacer interface {
// ResourceQuotaInterface has methods to work with ResourceQuota resources. // ResourceQuotaInterface has methods to work with ResourceQuota resources.
type ResourceQuotaInterface interface { type ResourceQuotaInterface interface {
List(label labels.Selector, field fields.Selector) (*api.ResourceQuotaList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ResourceQuotaList, error)
Get(name string) (*api.ResourceQuota, error) Get(name string) (*api.ResourceQuota, error)
Delete(name string) error Delete(name string) error
Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)
@@ -55,9 +55,9 @@ func newResourceQuotas(c *Client, namespace string) *resourceQuotas {
} }
// List takes a selector, and returns the list of resourceQuotas that match that selector. // List takes a selector, and returns the list of resourceQuotas that match that selector.
func (c *resourceQuotas) List(label labels.Selector, field fields.Selector) (result *api.ResourceQuotaList, err error) { func (c *resourceQuotas) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.ResourceQuotaList, err error) {
result = &api.ResourceQuotaList{} result = &api.ResourceQuotaList{}
err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }

View File

@@ -115,7 +115,7 @@ func TestResourceQuotaList(t *testing.T) {
}, },
Response: Response{StatusCode: 200, Body: resourceQuotaList}, Response: Response{StatusCode: 200, Body: resourceQuotaList},
} }
response, err := c.Setup(t).ResourceQuotas(ns).List(labels.Everything(), fields.Everything()) response, err := c.Setup(t).ResourceQuotas(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
c.Validate(t, response, err) c.Validate(t, response, err)
} }

View File

@@ -32,7 +32,7 @@ type SecretsInterface interface {
Create(secret *api.Secret) (*api.Secret, error) Create(secret *api.Secret) (*api.Secret, error)
Update(secret *api.Secret) (*api.Secret, error) Update(secret *api.Secret) (*api.Secret, error)
Delete(name string) error Delete(name string) error
List(label labels.Selector, field fields.Selector) (*api.SecretList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error)
Get(name string) (*api.Secret, error) Get(name string) (*api.Secret, error)
Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error)
} }
@@ -64,12 +64,13 @@ func (s *secrets) Create(secret *api.Secret) (*api.Secret, error) {
} }
// List returns a list of secrets matching the selectors. // List returns a list of secrets matching the selectors.
func (s *secrets) List(label labels.Selector, field fields.Selector) (*api.SecretList, error) { func (s *secrets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error) {
result := &api.SecretList{} result := &api.SecretList{}
err := s.client.Get(). err := s.client.Get().
Namespace(s.namespace). Namespace(s.namespace).
Resource("secrets"). Resource("secrets").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -32,7 +32,7 @@ type ServiceAccountsInterface interface {
Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
Delete(name string) error Delete(name string) error
List(label labels.Selector, field fields.Selector) (*api.ServiceAccountList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error)
Get(name string) (*api.ServiceAccount, error) Get(name string) (*api.ServiceAccount, error)
Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error)
} }
@@ -64,12 +64,13 @@ func (s *serviceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.Servi
} }
// List returns a list of serviceAccounts matching the selectors. // List returns a list of serviceAccounts matching the selectors.
func (s *serviceAccounts) List(label labels.Selector, field fields.Selector) (*api.ServiceAccountList, error) { func (s *serviceAccounts) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
result := &api.ServiceAccountList{} result := &api.ServiceAccountList{}
err := s.client.Get(). err := s.client.Get().
Namespace(s.namespace). Namespace(s.namespace).
Resource("serviceAccounts"). Resource("serviceAccounts").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -32,7 +32,7 @@ type ServicesNamespacer interface {
// ServiceInterface has methods to work with Service resources. // ServiceInterface has methods to work with Service resources.
type ServiceInterface interface { type ServiceInterface interface {
List(label labels.Selector, field fields.Selector) (*api.ServiceList, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceList, error)
Get(name string) (*api.Service, error) Get(name string) (*api.Service, error)
Create(srv *api.Service) (*api.Service, error) Create(srv *api.Service) (*api.Service, error)
Update(srv *api.Service) (*api.Service, error) Update(srv *api.Service) (*api.Service, error)
@@ -53,11 +53,12 @@ func newServices(c *Client, namespace string) *services {
} }
// List takes a selector, and returns the list of services that match that selector // List takes a selector, and returns the list of services that match that selector
func (c *services) List(label labels.Selector, field fields.Selector) (result *api.ServiceList, err error) { func (c *services) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.ServiceList, err error) {
result = &api.ServiceList{} result = &api.ServiceList{}
err = c.r.Get(). err = c.r.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("services"). Resource("services").
VersionedParams(&opts, api.Scheme).
LabelsSelectorParam(label). LabelsSelectorParam(label).
FieldsSelectorParam(field). FieldsSelectorParam(field).
Do(). Do().

View File

@@ -55,7 +55,7 @@ func TestListServices(t *testing.T) {
}, },
}, },
} }
receivedServiceList, err := c.Setup(t).Services(ns).List(labels.Everything(), fields.Everything()) receivedServiceList, err := c.Setup(t).Services(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
t.Logf("received services: %v %#v", err, receivedServiceList) t.Logf("received services: %v %#v", err, receivedServiceList)
c.Validate(t, receivedServiceList, err) c.Validate(t, receivedServiceList, err)
} }
@@ -92,7 +92,7 @@ func TestListServicesLabels(t *testing.T) {
c.Setup(t) c.Setup(t)
c.QueryValidator[labelSelectorQueryParamName] = validateLabels c.QueryValidator[labelSelectorQueryParamName] = validateLabels
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
receivedServiceList, err := c.Services(ns).List(selector, fields.Everything()) receivedServiceList, err := c.Services(ns).List(selector, fields.Everything(), unversioned.ListOptions{})
c.Validate(t, receivedServiceList, err) c.Validate(t, receivedServiceList, err)
} }

View File

@@ -43,7 +43,7 @@ func (c *FakeDaemonSets) Get(name string) (*extensions.DaemonSet, error) {
return obj.(*extensions.DaemonSet), err return obj.(*extensions.DaemonSet), err
} }
func (c *FakeDaemonSets) List(label labels.Selector, field fields.Selector) (*extensions.DaemonSetList, error) { func (c *FakeDaemonSets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DaemonSetList, error) {
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, field), &extensions.DaemonSetList{}) obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, field), &extensions.DaemonSetList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -41,7 +41,7 @@ func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
return obj.(*extensions.Deployment), err return obj.(*extensions.Deployment), err
} }
func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*extensions.DeploymentList, error) { func (c *FakeDeployments) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DeploymentList, error) {
obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &extensions.DeploymentList{}) obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &extensions.DeploymentList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
return obj.(*api.Endpoints), err return obj.(*api.Endpoints), err
} }
func (c *FakeEndpoints) List(label labels.Selector, field fields.Selector) (*api.EndpointsList, error) { func (c *FakeEndpoints) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EndpointsList, error) {
obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, label, field), &api.EndpointsList{}) obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, label, field), &api.EndpointsList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -47,7 +47,7 @@ func (c *FakeEvents) Get(name string) (*api.Event, error) {
} }
// List returns a list of events matching the selectors. // List returns a list of events matching the selectors.
func (c *FakeEvents) List(label labels.Selector, field fields.Selector) (*api.EventList, error) { func (c *FakeEvents) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error) {
action := NewRootListAction("events", label, field) action := NewRootListAction("events", label, field)
if c.Namespace != "" { if c.Namespace != "" {
action = NewListAction("events", c.Namespace, label, field) action = NewListAction("events", c.Namespace, label, field)

View File

@@ -41,7 +41,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string) (*extensions.HorizontalP
return obj.(*extensions.HorizontalPodAutoscaler), err return obj.(*extensions.HorizontalPodAutoscaler), err
} }
func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (*extensions.HorizontalPodAutoscalerList, error) { func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) {
obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &extensions.HorizontalPodAutoscalerList{}) obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &extensions.HorizontalPodAutoscalerList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -41,7 +41,7 @@ func (c *FakeIngress) Get(name string) (*extensions.Ingress, error) {
return obj.(*extensions.Ingress), err return obj.(*extensions.Ingress), err
} }
func (c *FakeIngress) List(label labels.Selector, fields fields.Selector) (*extensions.IngressList, error) { func (c *FakeIngress) List(label labels.Selector, fields fields.Selector, opts unversioned.ListOptions) (*extensions.IngressList, error) {
obj, err := c.Fake.Invokes(NewListAction("ingresses", c.Namespace, label, nil), &extensions.IngressList{}) obj, err := c.Fake.Invokes(NewListAction("ingresses", c.Namespace, label, nil), &extensions.IngressList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -41,7 +41,7 @@ func (c *FakeJobs) Get(name string) (*extensions.Job, error) {
return obj.(*extensions.Job), err return obj.(*extensions.Job), err
} }
func (c *FakeJobs) List(label labels.Selector, fields fields.Selector) (*extensions.JobList, error) { func (c *FakeJobs) List(label labels.Selector, fields fields.Selector, opts unversioned.ListOptions) (*extensions.JobList, error) {
obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, label, nil), &extensions.JobList{}) obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, label, nil), &extensions.JobList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error) {
return obj.(*api.LimitRange), err return obj.(*api.LimitRange), err
} }
func (c *FakeLimitRanges) List(label labels.Selector, field fields.Selector) (*api.LimitRangeList, error) { func (c *FakeLimitRanges) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.LimitRangeList, error) {
obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, label, field), &api.LimitRangeList{}) obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, label, field), &api.LimitRangeList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -39,7 +39,7 @@ func (c *FakeNamespaces) Get(name string) (*api.Namespace, error) {
return obj.(*api.Namespace), err return obj.(*api.Namespace), err
} }
func (c *FakeNamespaces) List(label labels.Selector, field fields.Selector) (*api.NamespaceList, error) { func (c *FakeNamespaces) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error) {
obj, err := c.Fake.Invokes(NewRootListAction("namespaces", label, field), &api.NamespaceList{}) obj, err := c.Fake.Invokes(NewRootListAction("namespaces", label, field), &api.NamespaceList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -39,7 +39,7 @@ func (c *FakeNodes) Get(name string) (*api.Node, error) {
return obj.(*api.Node), err return obj.(*api.Node), err
} }
func (c *FakeNodes) List(label labels.Selector, field fields.Selector) (*api.NodeList, error) { func (c *FakeNodes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
obj, err := c.Fake.Invokes(NewRootListAction("nodes", label, field), &api.NodeList{}) obj, err := c.Fake.Invokes(NewRootListAction("nodes", label, field), &api.NodeList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -38,7 +38,7 @@ func (c *FakePersistentVolumeClaims) Get(name string) (*api.PersistentVolumeClai
return obj.(*api.PersistentVolumeClaim), err return obj.(*api.PersistentVolumeClaim), err
} }
func (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeClaimList, error) { func (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) {
obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, label, field), &api.PersistentVolumeClaimList{}) obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, label, field), &api.PersistentVolumeClaimList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -37,7 +37,7 @@ func (c *FakePersistentVolumes) Get(name string) (*api.PersistentVolume, error)
return obj.(*api.PersistentVolume), err return obj.(*api.PersistentVolume), err
} }
func (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeList, error) { func (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeList, error) {
obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", label, field), &api.PersistentVolumeList{}) obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", label, field), &api.PersistentVolumeList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error) {
return obj.(*api.PodTemplate), err return obj.(*api.PodTemplate), err
} }
func (c *FakePodTemplates) List(label labels.Selector, field fields.Selector) (*api.PodTemplateList, error) { func (c *FakePodTemplates) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodTemplateList, error) {
obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, label, field), &api.PodTemplateList{}) obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, label, field), &api.PodTemplateList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -41,7 +41,7 @@ func (c *FakePods) Get(name string) (*api.Pod, error) {
return obj.(*api.Pod), err return obj.(*api.Pod), err
} }
func (c *FakePods) List(label labels.Selector, field fields.Selector) (*api.PodList, error) { func (c *FakePods) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodList, error) {
obj, err := c.Fake.Invokes(NewListAction("pods", c.Namespace, label, field), &api.PodList{}) obj, err := c.Fake.Invokes(NewListAction("pods", c.Namespace, label, field), &api.PodList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeReplicationControllers) Get(name string) (*api.ReplicationControlle
return obj.(*api.ReplicationController), err return obj.(*api.ReplicationController), err
} }
func (c *FakeReplicationControllers) List(label labels.Selector, field fields.Selector) (*api.ReplicationControllerList, error) { func (c *FakeReplicationControllers) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ReplicationControllerList, error) {
obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, label, field), &api.ReplicationControllerList{}) obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, label, field), &api.ReplicationControllerList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error) {
return obj.(*api.ResourceQuota), err return obj.(*api.ResourceQuota), err
} }
func (c *FakeResourceQuotas) List(label labels.Selector, field fields.Selector) (*api.ResourceQuotaList, error) { func (c *FakeResourceQuotas) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ResourceQuotaList, error) {
obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, label, field), &api.ResourceQuotaList{}) obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, label, field), &api.ResourceQuotaList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeSecrets) Get(name string) (*api.Secret, error) {
return obj.(*api.Secret), err return obj.(*api.Secret), err
} }
func (c *FakeSecrets) List(label labels.Selector, field fields.Selector) (*api.SecretList, error) { func (c *FakeSecrets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error) {
obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, label, field), &api.SecretList{}) obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, label, field), &api.SecretList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -40,7 +40,7 @@ func (c *FakeServiceAccounts) Get(name string) (*api.ServiceAccount, error) {
return obj.(*api.ServiceAccount), err return obj.(*api.ServiceAccount), err
} }
func (c *FakeServiceAccounts) List(label labels.Selector, field fields.Selector) (*api.ServiceAccountList, error) { func (c *FakeServiceAccounts) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, label, field), &api.ServiceAccountList{}) obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, label, field), &api.ServiceAccountList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -41,7 +41,7 @@ func (c *FakeServices) Get(name string) (*api.Service, error) {
return obj.(*api.Service), err return obj.(*api.Service), err
} }
func (c *FakeServices) List(label labels.Selector, field fields.Selector) (*api.ServiceList, error) { func (c *FakeServices) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceList, error) {
obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, label, field), &api.ServiceList{}) obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, label, field), &api.ServiceList{})
if obj == nil { if obj == nil {
return nil, err return nil, err

View File

@@ -22,6 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
@@ -34,7 +35,7 @@ func TestNewClient(t *testing.T) {
} }
client := &Fake{} client := &Fake{}
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper())) client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
list, err := client.Services("test").List(labels.Everything(), fields.Everything()) list, err := client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -43,7 +44,7 @@ func TestNewClient(t *testing.T) {
} }
// When list is invoked a second time, the same results are returned. // When list is invoked a second time, the same results are returned.
list, err = client.Services("test").List(labels.Everything(), fields.Everything()) list, err = client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -65,12 +66,12 @@ func TestErrors(t *testing.T) {
}) })
client := &Fake{} client := &Fake{}
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper())) client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
_, err := client.Services("test").List(labels.Everything(), fields.Everything()) _, err := client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if !errors.IsNotFound(err) { if !errors.IsNotFound(err) {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
t.Logf("error: %#v", err.(*errors.StatusError).Status()) t.Logf("error: %#v", err.(*errors.StatusError).Status())
_, err = client.Services("test").List(labels.Everything(), fields.Everything()) _, err = client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if !errors.IsForbidden(err) { if !errors.IsForbidden(err) {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }

View File

@@ -98,7 +98,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
dsc.dsStore.Store, dsc.dsController = framework.NewInformer( dsc.dsStore.Store, dsc.dsController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -130,7 +130,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
dsc.podStore.Store, dsc.podController = framework.NewInformer( dsc.podStore.Store, dsc.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return dsc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return dsc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -148,7 +148,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer( dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return dsc.kubeClient.Nodes().List(labels.Everything(), fields.Everything()) return dsc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return dsc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options) return dsc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -23,6 +23,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
@@ -60,7 +61,7 @@ func (d *DeploymentController) Run(syncPeriod time.Duration) {
} }
func (d *DeploymentController) reconcileDeployments() []error { func (d *DeploymentController) reconcileDeployments() []error {
list, err := d.expClient.Deployments(api.NamespaceAll).List(labels.Everything(), fields.Everything()) list, err := d.expClient.Deployments(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return []error{fmt.Errorf("error listing deployments: %v", err)} return []error{fmt.Errorf("error listing deployments: %v", err)}
} }

View File

@@ -64,7 +64,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
e.serviceStore.Store, e.serviceController = framework.NewInformer( e.serviceStore.Store, e.serviceController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return e.client.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -85,7 +85,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
e.podStore.Store, e.podController = framework.NewInformer( e.podStore.Store, e.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return e.client.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -386,7 +386,7 @@ func (e *EndpointController) syncService(key string) {
// some stragglers could have been left behind if the endpoint controller // some stragglers could have been left behind if the endpoint controller
// reboots). // reboots).
func (e *EndpointController) checkLeftoverEndpoints() { func (e *EndpointController) checkLeftoverEndpoints() {
list, err := e.client.Endpoints(api.NamespaceAll).List(labels.Everything(), fields.Everything()) list, err := e.client.Endpoints(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { 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) 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 return

View File

@@ -67,7 +67,7 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc,
gcc.podStore.Store, gcc.podStoreSyncer = framework.NewInformer( gcc.podStore.Store, gcc.podStoreSyncer = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return gcc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), terminatedSelector) return gcc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), terminatedSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return gcc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), terminatedSelector, options) return gcc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), terminatedSelector, options)

View File

@@ -86,7 +86,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
jm.jobStore.Store, jm.jobController = framework.NewInformer( jm.jobStore.Store, jm.jobController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -109,7 +109,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
jm.podStore.Store, jm.podController = framework.NewInformer( jm.podStore.Store, jm.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return jm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return jm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return jm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return jm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -48,7 +48,7 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A
_, controller = framework.NewInformer( _, controller = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.Namespaces().List(labels.Everything(), fields.Everything()) return kubeClient.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.Namespaces().Watch(labels.Everything(), fields.Everything(), options) return kubeClient.Namespaces().Watch(labels.Everything(), fields.Everything(), options)
@@ -339,7 +339,7 @@ func syncNamespace(kubeClient client.Interface, versions *unversioned.APIVersion
} }
func deleteLimitRanges(kubeClient client.Interface, ns string) error { func deleteLimitRanges(kubeClient client.Interface, ns string) error {
items, err := kubeClient.LimitRanges(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.LimitRanges(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -353,7 +353,7 @@ func deleteLimitRanges(kubeClient client.Interface, ns string) error {
} }
func deleteResourceQuotas(kubeClient client.Interface, ns string) error { func deleteResourceQuotas(kubeClient client.Interface, ns string) error {
resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(labels.Everything(), fields.Everything()) resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -367,7 +367,7 @@ func deleteResourceQuotas(kubeClient client.Interface, ns string) error {
} }
func deleteServiceAccounts(kubeClient client.Interface, ns string) error { func deleteServiceAccounts(kubeClient client.Interface, ns string) error {
items, err := kubeClient.ServiceAccounts(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.ServiceAccounts(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -381,7 +381,7 @@ func deleteServiceAccounts(kubeClient client.Interface, ns string) error {
} }
func deleteServices(kubeClient client.Interface, ns string) error { func deleteServices(kubeClient client.Interface, ns string) error {
items, err := kubeClient.Services(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.Services(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -395,7 +395,7 @@ func deleteServices(kubeClient client.Interface, ns string) error {
} }
func deleteReplicationControllers(kubeClient client.Interface, ns string) error { func deleteReplicationControllers(kubeClient client.Interface, ns string) error {
items, err := kubeClient.ReplicationControllers(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.ReplicationControllers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -409,7 +409,7 @@ func deleteReplicationControllers(kubeClient client.Interface, ns string) error
} }
func deletePods(kubeClient client.Interface, ns string, before unversioned.Time) (int64, error) { func deletePods(kubeClient client.Interface, ns string, before unversioned.Time) (int64, error) {
items, err := kubeClient.Pods(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.Pods(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return 0, err return 0, err
} }
@@ -438,7 +438,7 @@ func deletePods(kubeClient client.Interface, ns string, before unversioned.Time)
} }
func deleteEvents(kubeClient client.Interface, ns string) error { func deleteEvents(kubeClient client.Interface, ns string) error {
items, err := kubeClient.Events(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.Events(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -452,7 +452,7 @@ func deleteEvents(kubeClient client.Interface, ns string) error {
} }
func deleteSecrets(kubeClient client.Interface, ns string) error { func deleteSecrets(kubeClient client.Interface, ns string) error {
items, err := kubeClient.Secrets(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.Secrets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -466,7 +466,7 @@ func deleteSecrets(kubeClient client.Interface, ns string) error {
} }
func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error { func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error {
items, err := kubeClient.PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything()) items, err := kubeClient.PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -480,7 +480,7 @@ func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error
} }
func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns string) error { func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns string) error {
items, err := expClient.HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything()) items, err := expClient.HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -494,7 +494,7 @@ func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns str
} }
func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error { func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error {
items, err := expClient.DaemonSets(ns).List(labels.Everything(), fields.Everything()) items, err := expClient.DaemonSets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -508,7 +508,7 @@ func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error {
} }
func deleteJobs(expClient client.ExtensionsInterface, ns string) error { func deleteJobs(expClient client.ExtensionsInterface, ns string) error {
items, err := expClient.Jobs(ns).List(labels.Everything(), fields.Everything()) items, err := expClient.Jobs(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -522,7 +522,7 @@ func deleteJobs(expClient client.ExtensionsInterface, ns string) error {
} }
func deleteDeployments(expClient client.ExtensionsInterface, ns string) error { func deleteDeployments(expClient client.ExtensionsInterface, ns string) error {
items, err := expClient.Deployments(ns).List(labels.Everything(), fields.Everything()) items, err := expClient.Deployments(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -536,7 +536,7 @@ func deleteDeployments(expClient client.ExtensionsInterface, ns string) error {
} }
func deleteIngress(expClient client.ExtensionsInterface, ns string) error { func deleteIngress(expClient client.ExtensionsInterface, ns string) error {
items, err := expClient.Ingress(ns).List(labels.Everything(), fields.Everything()) items, err := expClient.Ingress(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }

View File

@@ -164,7 +164,7 @@ func NewNodeController(
nc.podStore.Store, nc.podController = framework.NewInformer( nc.podStore.Store, nc.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return nc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return nc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -180,7 +180,7 @@ func NewNodeController(
nc.nodeStore.Store, nc.nodeController = framework.NewInformer( nc.nodeStore.Store, nc.nodeController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything()) return nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return nc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options) return nc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options)
@@ -347,7 +347,7 @@ func forcefullyDeletePod(c client.Interface, pod *api.Pod) {
// post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or // post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or
// not reachable for a long period of time. // not reachable for a long period of time.
func (nc *NodeController) monitorNodeStatus() error { func (nc *NodeController) monitorNodeStatus() error {
nodes, err := nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything()) nodes, err := nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -684,7 +684,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap
// returns true if the provided node still has pods scheduled to it, or an error if // returns true if the provided node still has pods scheduled to it, or an error if
// the server could not be contacted. // the server could not be contacted.
func (nc *NodeController) hasPods(nodeName string) (bool, error) { func (nc *NodeController) hasPods(nodeName string) (bool, error) {
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName)) pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName), unversioned.ListOptions{})
if err != nil { if err != nil {
return false, err return false, err
} }
@@ -717,7 +717,7 @@ func (nc *NodeController) cancelPodEviction(nodeName string) bool {
// if any pods were deleted. // if any pods were deleted.
func (nc *NodeController) deletePods(nodeName string) (bool, error) { func (nc *NodeController) deletePods(nodeName string) (bool, error) {
remaining := false remaining := false
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName)) pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName), unversioned.ListOptions{})
if err != nil { if err != nil {
return remaining, err return remaining, err
} }
@@ -756,7 +756,8 @@ func (nc *NodeController) terminatePods(nodeName string, since time.Time) (bool,
complete := true complete := true
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(),
fields.OneTermEqualSelector(client.PodHost, nodeName)) fields.OneTermEqualSelector(client.PodHost, nodeName),
unversioned.ListOptions{})
if err != nil { if err != nil {
return false, nextAttempt, err return false, nextAttempt, err
} }

View File

@@ -91,7 +91,7 @@ func (m *FakeNodeHandler) Get(name string) (*api.Node, error) {
return nil, nil return nil, nil
} }
func (m *FakeNodeHandler) List(label labels.Selector, field fields.Selector) (*api.NodeList, error) { func (m *FakeNodeHandler) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
defer func() { m.RequestCount++ }() defer func() { m.RequestCount++ }()
var nodes []*api.Node var nodes []*api.Node
for i := 0; i < len(m.UpdatedNodes); i++ { for i := 0; i < len(m.UpdatedNodes); i++ {

View File

@@ -58,7 +58,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
_, volumeController := framework.NewInformer( _, volumeController := framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything()) return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options) return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options)
@@ -76,7 +76,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
_, claimController := framework.NewInformer( _, claimController := framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.PersistentVolumeClaims(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return kubeClient.PersistentVolumeClaims(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -65,7 +65,7 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du
_, volumeController := framework.NewInformer( _, volumeController := framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything()) return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options) return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -176,7 +176,7 @@ func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodA
func (a *HorizontalController) reconcileAutoscalers() error { func (a *HorizontalController) reconcileAutoscalers() error {
ns := api.NamespaceAll ns := api.NamespaceAll
list, err := a.client.Extensions().HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything()) list, err := a.client.Extensions().HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return fmt.Errorf("error listing nodes: %v", err) return fmt.Errorf("error listing nodes: %v", err)
} }

View File

@@ -25,6 +25,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -120,7 +121,7 @@ func (h *HeapsterMetricsClient) GetCPUUtilization(namespace string, selector map
func (h *HeapsterMetricsClient) GetResourceConsumptionAndRequest(resourceName api.ResourceName, namespace string, selector map[string]string) (consumption *ResourceConsumption, request *resource.Quantity, err error) { func (h *HeapsterMetricsClient) GetResourceConsumptionAndRequest(resourceName api.ResourceName, namespace string, selector map[string]string) (consumption *ResourceConsumption, request *resource.Quantity, err error) {
podList, err := h.client.Pods(namespace). podList, err := h.client.Pods(namespace).
List(labels.SelectorFromSet(labels.Set(selector)), fields.Everything()) List(labels.SelectorFromSet(labels.Set(selector)), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, nil, fmt.Errorf("failed to get pod list: %v", err) return nil, nil, fmt.Errorf("failed to get pod list: %v", err)

View File

@@ -109,7 +109,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
rm.rcStore.Store, rm.rcController = framework.NewInformer( rm.rcStore.Store, rm.rcController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -150,7 +150,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
rm.podStore.Store, rm.podController = framework.NewInformer( rm.podStore.Store, rm.podController = framework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return rm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return rm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return rm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return rm.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -23,6 +23,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -58,7 +59,7 @@ func (rm *ResourceQuotaController) Run(period time.Duration) {
func (rm *ResourceQuotaController) synchronize() { func (rm *ResourceQuotaController) synchronize() {
var resourceQuotas []api.ResourceQuota var resourceQuotas []api.ResourceQuota
list, err := rm.kubeClient.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything()) list, err := rm.kubeClient.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
glog.Errorf("Synchronization error: %v (%#v)", err, err) glog.Errorf("Synchronization error: %v (%#v)", err, err)
} }
@@ -142,7 +143,7 @@ func (rm *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e
pods := &api.PodList{} pods := &api.PodList{}
if set[api.ResourcePods] || set[api.ResourceMemory] || set[api.ResourceCPU] { if set[api.ResourcePods] || set[api.ResourceMemory] || set[api.ResourceCPU] {
pods, err = rm.kubeClient.Pods(usage.Namespace).List(labels.Everything(), fields.Everything()) pods, err = rm.kubeClient.Pods(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -165,31 +166,31 @@ func (rm *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e
case api.ResourcePods: case api.ResourcePods:
value = resource.NewQuantity(int64(len(filteredPods)), resource.DecimalSI) value = resource.NewQuantity(int64(len(filteredPods)), resource.DecimalSI)
case api.ResourceServices: case api.ResourceServices:
items, err := rm.kubeClient.Services(usage.Namespace).List(labels.Everything(), fields.Everything()) items, err := rm.kubeClient.Services(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
case api.ResourceReplicationControllers: case api.ResourceReplicationControllers:
items, err := rm.kubeClient.ReplicationControllers(usage.Namespace).List(labels.Everything(), fields.Everything()) items, err := rm.kubeClient.ReplicationControllers(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
case api.ResourceQuotas: case api.ResourceQuotas:
items, err := rm.kubeClient.ResourceQuotas(usage.Namespace).List(labels.Everything(), fields.Everything()) items, err := rm.kubeClient.ResourceQuotas(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
case api.ResourceSecrets: case api.ResourceSecrets:
items, err := rm.kubeClient.Secrets(usage.Namespace).List(labels.Everything(), fields.Everything()) items, err := rm.kubeClient.Secrets(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
case api.ResourcePersistentVolumeClaims: case api.ResourcePersistentVolumeClaims:
items, err := rm.kubeClient.PersistentVolumeClaims(usage.Namespace).List(labels.Everything(), fields.Everything()) items, err := rm.kubeClient.PersistentVolumeClaims(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }

View File

@@ -23,6 +23,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
@@ -61,7 +62,7 @@ func (rc *RouteController) reconcileNodeRoutes() error {
} }
// TODO (cjcullen): use pkg/controller/framework.NewInformer to watch this // TODO (cjcullen): use pkg/controller/framework.NewInformer to watch this
// and reduce the number of lists needed. // and reduce the number of lists needed.
nodeList, err := rc.kubeClient.Nodes().List(labels.Everything(), fields.Everything()) nodeList, err := rc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return fmt.Errorf("error listing nodes: %v", err) return fmt.Errorf("error listing nodes: %v", err)
} }

View File

@@ -79,7 +79,7 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer( e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), accountSelector) return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), accountSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), accountSelector, options) return e.client.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), accountSelector, options)
@@ -96,7 +96,7 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
e.namespaces, e.namespaceController = framework.NewIndexerInformer( e.namespaces, e.namespaceController = framework.NewIndexerInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Namespaces().List(labels.Everything(), fields.Everything()) return e.client.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Namespaces().Watch(labels.Everything(), fields.Everything(), options) return e.client.Namespaces().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -64,7 +64,7 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer( e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return e.client.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -84,7 +84,7 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
e.secrets, e.secretController = framework.NewIndexerInformer( e.secrets, e.secretController = framework.NewIndexerInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return e.client.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector) return e.client.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return e.client.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options) return e.client.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options)

View File

@@ -342,7 +342,7 @@ func GetFirstPod(client *client.Client, namespace string, selector map[string]st
var pods *api.PodList var pods *api.PodList
for pods == nil || len(pods.Items) == 0 { for pods == nil || len(pods.Items) == 0 {
var err error var err error
if pods, err = client.Pods(namespace).List(labels.SelectorFromSet(selector), fields.Everything()); err != nil { if pods, err = client.Pods(namespace).List(labels.SelectorFromSet(selector), fields.Everything(), unversioned.ListOptions{}); err != nil {
return nil, err return nil, err
} }
if len(pods.Items) == 0 { if len(pods.Items) == 0 {

View File

@@ -141,11 +141,11 @@ func (d *NamespaceDescriber) Describe(namespace, name string) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
resourceQuotaList, err := d.ResourceQuotas(name).List(labels.Everything(), fields.Everything()) resourceQuotaList, err := d.ResourceQuotas(name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return "", err return "", err
} }
limitRangeList, err := d.LimitRanges(name).List(labels.Everything(), fields.Everything()) limitRangeList, err := d.LimitRanges(name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return "", err return "", err
} }
@@ -424,7 +424,8 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
eventsInterface := d.Events(namespace) eventsInterface := d.Events(namespace)
events, err2 := eventsInterface.List( events, err2 := eventsInterface.List(
labels.Everything(), labels.Everything(),
eventsInterface.GetFieldSelector(&name, &namespace, nil, nil)) eventsInterface.GetFieldSelector(&name, &namespace, nil, nil),
unversioned.ListOptions{})
if err2 == nil && len(events.Items) > 0 { if err2 == nil && len(events.Items) > 0 {
return tabbedString(func(out io.Writer) error { return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Pod '%v': error '%v', but found events.\n", name, err) fmt.Fprintf(out, "Pod '%v': error '%v', but found events.\n", name, err)
@@ -1190,7 +1191,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string) (string, erro
tokens := []api.Secret{} tokens := []api.Secret{}
tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)})
secrets, err := d.Secrets(namespace).List(labels.Everything(), tokenSelector) secrets, err := d.Secrets(namespace).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
if err == nil { if err == nil {
for _, s := range secrets.Items { for _, s := range secrets.Items {
name, _ := s.Annotations[api.ServiceAccountNameKey] name, _ := s.Annotations[api.ServiceAccountNameKey]
@@ -1267,7 +1268,7 @@ func (d *NodeDescriber) Describe(namespace, name string) (string, error) {
} }
var pods []*api.Pod var pods []*api.Pod
allPods, err := d.Pods(namespace).List(labels.Everything(), fields.Everything()) allPods, err := d.Pods(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return "", err return "", err
} }
@@ -1545,7 +1546,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error)
func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.Labels) ([]extensions.DaemonSet, error) { func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.Labels) ([]extensions.DaemonSet, error) {
// Get all daemon sets // Get all daemon sets
// TODO: this needs a namespace scope as argument // TODO: this needs a namespace scope as argument
dss, err := c.List(labels.Everything(), fields.Everything()) dss, err := c.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting daemon set: %v", err) return nil, fmt.Errorf("error getting daemon set: %v", err)
} }
@@ -1572,7 +1573,7 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La
func getReplicationControllersForLabels(c client.ReplicationControllerInterface, labelsToMatch labels.Labels) ([]api.ReplicationController, error) { func getReplicationControllersForLabels(c client.ReplicationControllerInterface, labelsToMatch labels.Labels) ([]api.ReplicationController, error) {
// Get all replication controllers. // Get all replication controllers.
// TODO this needs a namespace scope as argument // TODO this needs a namespace scope as argument
rcs, err := c.List(labels.Everything(), fields.Everything()) rcs, err := c.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting replication controllers: %v", err) return nil, fmt.Errorf("error getting replication controllers: %v", err)
} }
@@ -1603,7 +1604,7 @@ func printReplicationControllersByLabels(matchingRCs []*api.ReplicationControlle
} }
func getPodStatusForController(c client.PodInterface, selector labels.Selector) (running, waiting, succeeded, failed int, err error) { func getPodStatusForController(c client.PodInterface, selector labels.Selector) (running, waiting, succeeded, failed int, err error) {
rcPods, err := c.List(selector, fields.Everything()) rcPods, err := c.List(selector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return return
} }

View File

@@ -27,6 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -363,7 +364,7 @@ func (r *RollingUpdater) pollForReadyPods(interval, timeout time.Duration, oldRc
anyReady := false anyReady := false
for _, controller := range controllers { for _, controller := range controllers {
selector := labels.Set(controller.Spec.Selector).AsSelector() selector := labels.Set(controller.Spec.Selector).AsSelector()
pods, err := r.c.Pods(controller.Namespace).List(selector, fields.Everything()) pods, err := r.c.Pods(controller.Namespace).List(selector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return false, err return false, err
} }
@@ -627,7 +628,7 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c
// Update all pods managed by the rc to have the new hash label, so they are correctly adopted // Update all pods managed by the rc to have the new hash label, so they are correctly adopted
// TODO: extract the code from the label command and re-use it here. // TODO: extract the code from the label command and re-use it here.
podList, err := client.Pods(namespace).List(labels.SelectorFromSet(oldRc.Spec.Selector), fields.Everything()) podList, err := client.Pods(namespace).List(labels.SelectorFromSet(oldRc.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -677,7 +678,7 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c
// Clean up any orphaned pods that don't have the new label, this can happen if the rc manager // Clean up any orphaned pods that don't have the new label, this can happen if the rc manager
// doesn't see the update to its pod template and creates a new pod with the old labels after // doesn't see the update to its pod template and creates a new pod with the old labels after
// we've finished re-adopting existing pods to the rc. // we've finished re-adopting existing pods to the rc.
podList, err = client.Pods(namespace).List(labels.SelectorFromSet(selectorCopy), fields.Everything()) podList, err = client.Pods(namespace).List(labels.SelectorFromSet(selectorCopy), fields.Everything(), unversioned.ListOptions{})
for ix := range podList.Items { for ix := range podList.Items {
pod := &podList.Items[ix] pod := &podList.Items[ix]
if value, found := pod.Labels[deploymentKey]; !found || value != deploymentValue { if value, found := pod.Labels[deploymentKey]; !found || value != deploymentValue {
@@ -718,7 +719,7 @@ func updateWithRetries(rcClient client.ReplicationControllerInterface, rc *api.R
} }
func FindSourceController(r client.ReplicationControllersNamespacer, namespace, name string) (*api.ReplicationController, error) { func FindSourceController(r client.ReplicationControllersNamespacer, namespace, name string) (*api.ReplicationController, error) {
list, err := r.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything()) list, err := r.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@@ -109,7 +109,7 @@ type objInterface interface {
// getOverlappingControllers finds rcs that this controller overlaps, as well as rcs overlapping this controller. // getOverlappingControllers finds rcs that this controller overlaps, as well as rcs overlapping this controller.
func getOverlappingControllers(c client.ReplicationControllerInterface, rc *api.ReplicationController) ([]api.ReplicationController, error) { func getOverlappingControllers(c client.ReplicationControllerInterface, rc *api.ReplicationController) ([]api.ReplicationController, error) {
rcs, err := c.List(labels.Everything(), fields.Everything()) rcs, err := c.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting replication controllers: %v", err) return nil, fmt.Errorf("error getting replication controllers: %v", err)
} }
@@ -252,7 +252,7 @@ func (reaper *JobReaper) Stop(namespace, name string, timeout time.Duration, gra
} }
// at this point only dead pods are left, that should be removed // at this point only dead pods are left, that should be removed
selector, _ := extensions.PodSelectorAsSelector(job.Spec.Selector) selector, _ := extensions.PodSelectorAsSelector(job.Spec.Selector)
podList, err := pods.List(selector, fields.Everything()) podList, err := pods.List(selector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }

View File

@@ -237,7 +237,7 @@ func NewMainKubelet(
// than an interface. There is no way to construct a list+watcher using resource name. // than an interface. There is no way to construct a list+watcher using resource name.
listWatch := &cache.ListWatch{ listWatch := &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return kubeClient.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return kubeClient.Services(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -254,7 +254,7 @@ func NewMainKubelet(
fieldSelector := fields.Set{client.ObjectNameField: nodeName}.AsSelector() fieldSelector := fields.Set{client.ObjectNameField: nodeName}.AsSelector()
listWatch := &cache.ListWatch{ listWatch := &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return kubeClient.Nodes().List(labels.Everything(), fieldSelector) return kubeClient.Nodes().List(labels.Everything(), fieldSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return kubeClient.Nodes().Watch(labels.Everything(), fieldSelector, options) return kubeClient.Nodes().Watch(labels.Everything(), fieldSelector, options)

View File

@@ -21,6 +21,7 @@ import (
"hash/adler32" "hash/adler32"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
@@ -32,14 +33,14 @@ import (
func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.ReplicationController, error) { func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.ReplicationController, error) {
namespace := deployment.ObjectMeta.Namespace namespace := deployment.ObjectMeta.Namespace
// 1. Find all pods whose labels match deployment.Spec.Selector // 1. Find all pods whose labels match deployment.Spec.Selector
podList, err := c.Pods(namespace).List(labels.SelectorFromSet(deployment.Spec.Selector), fields.Everything()) podList, err := c.Pods(namespace).List(labels.SelectorFromSet(deployment.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error listing pods: %v", err) return nil, fmt.Errorf("error listing pods: %v", err)
} }
// 2. Find the corresponding RCs for pods in podList. // 2. Find the corresponding RCs for pods in podList.
// TODO: Right now we list all RCs and then filter. We should add an API for this. // TODO: Right now we list all RCs and then filter. We should add an API for this.
oldRCs := map[string]api.ReplicationController{} oldRCs := map[string]api.ReplicationController{}
rcList, err := c.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything()) rcList, err := c.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error listing replication controllers: %v", err) return nil, fmt.Errorf("error listing replication controllers: %v", err)
} }
@@ -68,7 +69,7 @@ func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.Rep
// Returns nil if the new RC doesnt exist yet. // Returns nil if the new RC doesnt exist yet.
func GetNewRC(deployment extensions.Deployment, c client.Interface) (*api.ReplicationController, error) { func GetNewRC(deployment extensions.Deployment, c client.Interface) (*api.ReplicationController, error) {
namespace := deployment.ObjectMeta.Namespace namespace := deployment.ObjectMeta.Namespace
rcList, err := c.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything()) rcList, err := c.ReplicationControllers(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return nil, fmt.Errorf("error listing replication controllers: %v", err) return nil, fmt.Errorf("error listing replication controllers: %v", err)
} }
@@ -148,7 +149,7 @@ func GetAvailablePodsForRCs(c client.Interface, rcs []*api.ReplicationController
func getPodsForRCs(c client.Interface, replicationControllers []*api.ReplicationController) ([]api.Pod, error) { func getPodsForRCs(c client.Interface, replicationControllers []*api.ReplicationController) ([]api.Pod, error) {
allPods := []api.Pod{} allPods := []api.Pod{}
for _, rc := range replicationControllers { for _, rc := range replicationControllers {
podList, err := c.Pods(rc.ObjectMeta.Namespace).List(labels.SelectorFromSet(rc.Spec.Selector), fields.Everything()) podList, err := c.Pods(rc.ObjectMeta.Namespace).List(labels.SelectorFromSet(rc.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return allPods, fmt.Errorf("error listing pods: %v", err) return allPods, fmt.Errorf("error listing pods: %v", err)
} }

View File

@@ -110,7 +110,7 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s
podLW := &cache.ListWatch{ podLW := &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.client.Pods(namespace).List(labels.Everything(), fieldSelector) return c.client.Pods(namespace).List(labels.Everything(), fieldSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.client.Pods(namespace).Watch(labels.Everything(), fieldSelector, options) return c.client.Pods(namespace).Watch(labels.Everything(), fieldSelector, options)

View File

@@ -101,7 +101,7 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Interface { func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Interface {
lw := &cache.ListWatch{ lw := &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return client.LimitRanges(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return client.LimitRanges(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return client.LimitRanges(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return client.LimitRanges(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -86,7 +86,7 @@ func NewProvision(c client.Interface) admission.Interface {
reflector := cache.NewReflector( reflector := cache.NewReflector(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything()) return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -93,7 +93,7 @@ func NewExists(c client.Interface) admission.Interface {
reflector := cache.NewReflector( reflector := cache.NewReflector(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything()) return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -110,7 +110,7 @@ func NewLifecycle(c client.Interface) admission.Interface {
reflector := cache.NewReflector( reflector := cache.NewReflector(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.Namespaces().List(labels.Everything(), fields.Everything()) return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -52,7 +52,7 @@ type quota struct {
func NewResourceQuota(client client.Interface) admission.Interface { func NewResourceQuota(client client.Interface) admission.Interface {
lw := &cache.ListWatch{ lw := &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return client.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return client.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return client.ResourceQuotas(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return client.ResourceQuotas(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)

View File

@@ -84,7 +84,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
serviceAccountsIndexer, serviceAccountsReflector := cache.NewNamespaceKeyedIndexerAndReflector( serviceAccountsIndexer, serviceAccountsReflector := cache.NewNamespaceKeyedIndexerAndReflector(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return cl.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything()) return cl.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return cl.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options) return cl.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), options)
@@ -98,7 +98,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
secretsIndexer, secretsReflector := cache.NewNamespaceKeyedIndexerAndReflector( secretsIndexer, secretsReflector := cache.NewNamespaceKeyedIndexerAndReflector(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return cl.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector) return cl.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return cl.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options) return cl.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options)

View File

@@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"time" "time"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -49,7 +50,7 @@ var _ = Describe("Cadvisor", func() {
func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) { func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) {
By("getting list of nodes") By("getting list of nodes")
nodeList, err := c.Nodes().List(labels.Everything(), fields.Everything()) nodeList, err := c.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
expectNoError(err) expectNoError(err)
var errors []error var errors []error
retries := maxRetries retries := maxRetries

View File

@@ -22,6 +22,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -43,7 +44,7 @@ var _ = Describe("[Autoscaling] [Skipped]", func() {
BeforeEach(func() { BeforeEach(func() {
SkipUnlessProviderIs("gce") SkipUnlessProviderIs("gce")
nodes, err := f.Client.Nodes().List(labels.Everything(), fields.Everything()) nodes, err := f.Client.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
expectNoError(err) expectNoError(err)
nodeCount = len(nodes.Items) nodeCount = len(nodes.Items)
Expect(nodeCount).NotTo(BeZero()) Expect(nodeCount).NotTo(BeZero())

View File

@@ -29,6 +29,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -412,7 +413,7 @@ func runCmd(command string, args ...string) (string, string, error) {
func validate(f *Framework, svcNameWant, rcNameWant string, ingress api.LoadBalancerIngress, podsWant int) error { func validate(f *Framework, svcNameWant, rcNameWant string, ingress api.LoadBalancerIngress, podsWant int) error {
Logf("Beginning cluster validation") Logf("Beginning cluster validation")
// Verify RC. // Verify RC.
rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(labels.Everything(), fields.Everything()) rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return fmt.Errorf("error listing RCs: %v", err) return fmt.Errorf("error listing RCs: %v", err)
} }

View File

@@ -171,7 +171,7 @@ func replacePods(pods []*api.Pod, store cache.Store) {
// getContainerRestarts returns the count of container restarts across all pods matching the given labelSelector, // getContainerRestarts returns the count of container restarts across all pods matching the given labelSelector,
// and a list of nodenames across which these containers restarted. // and a list of nodenames across which these containers restarted.
func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Selector) (int, []string) { func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Selector) (int, []string) {
pods, err := c.Pods(ns).List(labelSelector, fields.Everything()) pods, err := c.Pods(ns).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
expectNoError(err) expectNoError(err)
failedContainers := 0 failedContainers := 0
containerRestartNodes := sets.NewString() containerRestartNodes := sets.NewString()
@@ -221,7 +221,7 @@ var _ = Describe("DaemonRestart", func() {
newPods, controller = controllerframework.NewInformer( newPods, controller = controllerframework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return framework.Client.Pods(ns).List(labelSelector, fields.Everything()) return framework.Client.Pods(ns).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return framework.Client.Pods(ns).Watch(labelSelector, fields.Everything(), options) return framework.Client.Pods(ns).Watch(labelSelector, fields.Everything(), options)

View File

@@ -114,7 +114,7 @@ var _ = Describe("Daemon set", func() {
By("Stop a daemon pod, check that the daemon pod is revived.") By("Stop a daemon pod, check that the daemon pod is revived.")
podClient := c.Pods(ns) podClient := c.Pods(ns)
podList, err := podClient.List(labels.Set(label).AsSelector(), fields.Everything()) podList, err := podClient.List(labels.Set(label).AsSelector(), fields.Everything(), unversioned.ListOptions{})
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
Expect(len(podList.Items)).To(BeNumerically(">", 0)) Expect(len(podList.Items)).To(BeNumerically(">", 0))
pod := podList.Items[0] pod := podList.Items[0]
@@ -160,7 +160,7 @@ var _ = Describe("Daemon set", func() {
By("Change label of node, check that daemon pod is launched.") By("Change label of node, check that daemon pod is launched.")
nodeClient := c.Nodes() nodeClient := c.Nodes()
nodeList, err := nodeClient.List(labels.Everything(), fields.Everything()) nodeList, err := nodeClient.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
Expect(len(nodeList.Items)).To(BeNumerically(">", 0)) Expect(len(nodeList.Items)).To(BeNumerically(">", 0))
newNode, err := setDaemonSetNodeLabels(c, nodeList.Items[0].Name, nodeSelector) newNode, err := setDaemonSetNodeLabels(c, nodeList.Items[0].Name, nodeSelector)
Expect(err).NotTo(HaveOccurred(), "error setting labels on node") Expect(err).NotTo(HaveOccurred(), "error setting labels on node")
@@ -196,7 +196,7 @@ func separateDaemonSetNodeLabels(labels map[string]string) (map[string]string, m
func clearDaemonSetNodeLabels(c *client.Client) error { func clearDaemonSetNodeLabels(c *client.Client) error {
nodeClient := c.Nodes() nodeClient := c.Nodes()
nodeList, err := nodeClient.List(labels.Everything(), fields.Everything()) nodeList, err := nodeClient.List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return err return err
} }
@@ -251,7 +251,7 @@ func setDaemonSetNodeLabels(c *client.Client, nodeName string, labels map[string
func checkDaemonPodOnNodes(f *Framework, selector map[string]string, nodeNames []string) func() (bool, error) { func checkDaemonPodOnNodes(f *Framework, selector map[string]string, nodeNames []string) func() (bool, error) {
return func() (bool, error) { return func() (bool, error) {
podList, err := f.Client.Pods(f.Namespace.Name).List(labels.Set(selector).AsSelector(), fields.Everything()) podList, err := f.Client.Pods(f.Namespace.Name).List(labels.Set(selector).AsSelector(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return false, nil return false, nil
} }
@@ -279,7 +279,7 @@ func checkDaemonPodOnNodes(f *Framework, selector map[string]string, nodeNames [
func checkRunningOnAllNodes(f *Framework, selector map[string]string) func() (bool, error) { func checkRunningOnAllNodes(f *Framework, selector map[string]string) func() (bool, error) {
return func() (bool, error) { return func() (bool, error) {
nodeList, err := f.Client.Nodes().List(labels.Everything(), fields.Everything()) nodeList, err := f.Client.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
return false, nil return false, nil
} }

View File

@@ -156,7 +156,7 @@ var _ = Describe("Density [Skipped]", func() {
ns = framework.Namespace.Name ns = framework.Namespace.Name
var err error var err error
nodes, err := c.Nodes().List(labels.Everything(), fields.Everything()) nodes, err := c.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
expectNoError(err) expectNoError(err)
nodeCount = len(nodes.Items) nodeCount = len(nodes.Items)
Expect(nodeCount).NotTo(BeZero()) Expect(nodeCount).NotTo(BeZero())
@@ -234,7 +234,7 @@ var _ = Describe("Density [Skipped]", func() {
_, controller := controllerframework.NewInformer( _, controller := controllerframework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.Events(ns).List(labels.Everything(), fields.Everything()) return c.Events(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.Events(ns).Watch(labels.Everything(), fields.Everything(), options) return c.Events(ns).Watch(labels.Everything(), fields.Everything(), options)
@@ -317,7 +317,7 @@ var _ = Describe("Density [Skipped]", func() {
_, controller := controllerframework.NewInformer( _, controller := controllerframework.NewInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything()) return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), unversioned.ListOptions{})
}, },
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options) return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options)
@@ -369,7 +369,8 @@ var _ = Describe("Density [Skipped]", func() {
"involvedObject.kind": "Pod", "involvedObject.kind": "Pod",
"involvedObject.namespace": ns, "involvedObject.namespace": ns,
"source": "scheduler", "source": "scheduler",
}.AsSelector()) }.AsSelector(),
unversioned.ListOptions{})
expectNoError(err) expectNoError(err)
for k := range createTimes { for k := range createTimes {
for _, event := range schedEvents.Items { for _, event := range schedEvents.Items {

View File

@@ -191,7 +191,7 @@ var _ = Describe("DNS", func() {
systemClient := f.Client.Pods(api.NamespaceSystem) systemClient := f.Client.Pods(api.NamespaceSystem)
By("Waiting for DNS Service to be Running") By("Waiting for DNS Service to be Running")
dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything()) dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
Failf("Failed to list all dns service pods") Failf("Failed to list all dns service pods")
} }
@@ -229,7 +229,7 @@ var _ = Describe("DNS", func() {
systemClient := f.Client.Pods(api.NamespaceSystem) systemClient := f.Client.Pods(api.NamespaceSystem)
By("Waiting for DNS Service to be Running") By("Waiting for DNS Service to be Running")
dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything()) dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
Failf("Failed to list all dns service pods") Failf("Failed to list all dns service pods")
} }

View File

@@ -24,6 +24,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -85,7 +86,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// Wait for the Elasticsearch pods to enter the running state. // Wait for the Elasticsearch pods to enter the running state.
By("Checking to make sure the Elasticsearch pods are running") By("Checking to make sure the Elasticsearch pods are running")
label := labels.SelectorFromSet(labels.Set(map[string]string{esKey: esValue})) label := labels.SelectorFromSet(labels.Set(map[string]string{esKey: esValue}))
pods, err := f.Client.Pods(api.NamespaceSystem).List(label, fields.Everything()) pods, err := f.Client.Pods(api.NamespaceSystem).List(label, fields.Everything(), unversioned.ListOptions{})
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
for _, pod := range pods.Items { for _, pod := range pods.Items {
err = waitForPodRunningInNamespace(f.Client, pod.Name, api.NamespaceSystem) err = waitForPodRunningInNamespace(f.Client, pod.Name, api.NamespaceSystem)
@@ -171,7 +172,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
} }
// Obtain a list of nodes so we can place one synthetic logger on each node. // Obtain a list of nodes so we can place one synthetic logger on each node.
nodes, err := f.Client.Nodes().List(labels.Everything(), fields.Everything()) nodes, err := f.Client.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
Failf("Failed to list nodes: %v", err) Failf("Failed to list nodes: %v", err)
} }
@@ -257,7 +258,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
for start := time.Now(); time.Since(start) < ingestionTimeout; time.Sleep(10 * time.Second) { for start := time.Now(); time.Since(start) < ingestionTimeout; time.Sleep(10 * time.Second) {
// Debugging code to report the status of the elasticsearch logging endpoints. // Debugging code to report the status of the elasticsearch logging endpoints.
esPods, err := f.Client.Pods(api.NamespaceSystem).List(labels.Set{esKey: esValue}.AsSelector(), fields.Everything()) esPods, err := f.Client.Pods(api.NamespaceSystem).List(labels.Set{esKey: esValue}.AsSelector(), fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
Logf("Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v", err) Logf("Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v", err)
continue continue

View File

@@ -20,6 +20,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
@@ -108,7 +109,7 @@ func checkExistingRCRecovers(f *Framework) {
By("deleting pods from existing replication controller") By("deleting pods from existing replication controller")
expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) { expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) {
pods, err := podClient.List(rcSelector, fields.Everything()) pods, err := podClient.List(rcSelector, fields.Everything(), unversioned.ListOptions{})
if err != nil { if err != nil {
Logf("apiserver returned error, as expected before recovery: %v", err) Logf("apiserver returned error, as expected before recovery: %v", err)
return false, nil return false, nil
@@ -126,7 +127,7 @@ func checkExistingRCRecovers(f *Framework) {
By("waiting for replication controller to recover") By("waiting for replication controller to recover")
expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) { expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) {
pods, err := podClient.List(rcSelector, fields.Everything()) pods, err := podClient.List(rcSelector, fields.Everything(), unversioned.ListOptions{})
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
for _, pod := range pods.Items { for _, pod := range pods.Items {
if pod.DeletionTimestamp == nil && api.IsPodReady(&pod) { if pod.DeletionTimestamp == nil && api.IsPodReady(&pod) {

View File

@@ -22,6 +22,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
@@ -72,7 +73,7 @@ var _ = Describe("Events", func() {
expectNoError(framework.WaitForPodRunning(pod.Name)) expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the pod is in kubernetes") By("verifying the pod is in kubernetes")
pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything()) pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything(), unversioned.ListOptions{})
Expect(len(pods.Items)).To(Equal(1)) Expect(len(pods.Items)).To(Equal(1))
By("retrieving the pod") By("retrieving the pod")
@@ -93,6 +94,7 @@ var _ = Describe("Events", func() {
"involvedObject.namespace": framework.Namespace.Name, "involvedObject.namespace": framework.Namespace.Name,
"source": "scheduler", "source": "scheduler",
}.AsSelector(), }.AsSelector(),
unversioned.ListOptions{},
) )
if err != nil { if err != nil {
return false, err return false, err
@@ -114,6 +116,7 @@ var _ = Describe("Events", func() {
"involvedObject.namespace": framework.Namespace.Name, "involvedObject.namespace": framework.Namespace.Name,
"source": "kubelet", "source": "kubelet",
}.AsSelector(), }.AsSelector(),
unversioned.ListOptions{},
) )
if err != nil { if err != nil {
return false, err return false, err

View File

@@ -22,6 +22,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
@@ -104,7 +105,7 @@ var _ = Describe("[Example] ClusterDns", func() {
// the application itself may have not been initialized. Just query the application. // the application itself may have not been initialized. Just query the application.
for _, ns := range namespaces { for _, ns := range namespaces {
label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendRcName})) label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendRcName}))
pods, err := c.Pods(ns.Name).List(label, fields.Everything()) pods, err := c.Pods(ns.Name).List(label, fields.Everything(), unversioned.ListOptions{})
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
err = podsResponding(c, ns.Name, backendPodName, false, pods) err = podsResponding(c, ns.Name, backendPodName, false, pods)
Expect(err).NotTo(HaveOccurred(), "waiting for all pods to respond") Expect(err).NotTo(HaveOccurred(), "waiting for all pods to respond")
@@ -123,7 +124,7 @@ var _ = Describe("[Example] ClusterDns", func() {
// dns error or timeout. // dns error or timeout.
// This code is probably unnecessary, but let's stay on the safe side. // This code is probably unnecessary, but let's stay on the safe side.
label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendPodName})) label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendPodName}))
pods, err := c.Pods(namespaces[0].Name).List(label, fields.Everything()) pods, err := c.Pods(namespaces[0].Name).List(label, fields.Everything(), unversioned.ListOptions{})
if err != nil || pods == nil || len(pods.Items) == 0 { if err != nil || pods == nil || len(pods.Items) == 0 {
Failf("no running pods found") Failf("no running pods found")

Some files were not shown because too many files have changed in this diff Show More