diff --git a/contrib/mesos/pkg/service/endpoints_controller.go b/contrib/mesos/pkg/service/endpoints_controller.go index b8c5f21415b..7a507df0c1f 100644 --- a/contrib/mesos/pkg/service/endpoints_controller.go +++ b/contrib/mesos/pkg/service/endpoints_controller.go @@ -63,7 +63,7 @@ func NewEndpointController(client *client.Client) *endpointController { return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Service{}, @@ -83,7 +83,7 @@ func NewEndpointController(client *client.Client) *endpointController { return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, diff --git a/pkg/client/unversioned/daemon_sets.go b/pkg/client/unversioned/daemon_sets.go index e8c79e1dc58..fa17a63567c 100644 --- a/pkg/client/unversioned/daemon_sets.go +++ b/pkg/client/unversioned/daemon_sets.go @@ -37,7 +37,7 @@ type DaemonSetInterface interface { Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) UpdateStatus(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) Delete(name string) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // daemonSets implements DaemonsSetsNamespacer interface @@ -93,13 +93,11 @@ func (c *daemonSets) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested daemon sets. -func (c *daemonSets) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *daemonSets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/deployment.go b/pkg/client/unversioned/deployment.go index 21960f18401..34d9f3e8d76 100644 --- a/pkg/client/unversioned/deployment.go +++ b/pkg/client/unversioned/deployment.go @@ -38,7 +38,7 @@ type DeploymentInterface interface { Create(*extensions.Deployment) (*extensions.Deployment, error) Update(*extensions.Deployment) (*extensions.Deployment, error) UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // deployments implements DeploymentInterface @@ -102,13 +102,11 @@ func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (result *e } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/deployment_test.go b/pkg/client/unversioned/deployment_test.go index 475cd36d930..989ce54ea9f 100644 --- a/pkg/client/unversioned/deployment_test.go +++ b/pkg/client/unversioned/deployment_test.go @@ -169,6 +169,6 @@ func TestDeploymentWatch(t *testing.T) { }, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).Deployments(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).Deployments(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/endpoints.go b/pkg/client/unversioned/endpoints.go index 02195818369..ad85cdcd9ef 100644 --- a/pkg/client/unversioned/endpoints.go +++ b/pkg/client/unversioned/endpoints.go @@ -38,7 +38,7 @@ type EndpointsInterface interface { Get(name string) (*api.Endpoints, error) Delete(name string) error Update(endpoints *api.Endpoints) (*api.Endpoints, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // endpoints implements EndpointsInterface @@ -86,14 +86,12 @@ func (c *endpoints) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested endpoints for a service. -func (c *endpoints) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *endpoints) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("endpoints"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/events.go b/pkg/client/unversioned/events.go index 87f8f5fc696..d357cee1099 100644 --- a/pkg/client/unversioned/events.go +++ b/pkg/client/unversioned/events.go @@ -39,7 +39,7 @@ type EventInterface interface { Patch(event *api.Event, data []byte) (*api.Event, error) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error) Get(name string) (*api.Event, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) // Search finds events about the specified object Search(objOrRef runtime.Object) (*api.EventList, error) Delete(name string) error @@ -143,14 +143,12 @@ func (e *events) Get(name string) (*api.Event, error) { } // Watch starts watching for events matching the given selectors. -func (e *events) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (e *events) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return e.client.Get(). Prefix("watch"). NamespaceIfScoped(e.namespace, len(e.namespace) > 0). Resource("events"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/horizontalpodautoscaler.go b/pkg/client/unversioned/horizontalpodautoscaler.go index f4130e7a6f3..89a5e25a2db 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler.go +++ b/pkg/client/unversioned/horizontalpodautoscaler.go @@ -38,7 +38,7 @@ type HorizontalPodAutoscalerInterface interface { Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) Update(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) UpdateStatus(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface @@ -104,13 +104,11 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *extensi } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *horizontalPodAutoscalers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.ns). Resource("horizontalPodAutoscalers"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/horizontalpodautoscaler_test.go b/pkg/client/unversioned/horizontalpodautoscaler_test.go index b7d462931da..e34d6670d5e 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler_test.go +++ b/pkg/client/unversioned/horizontalpodautoscaler_test.go @@ -156,6 +156,6 @@ func TestHorizontalPodAutoscalerWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/ingress.go b/pkg/client/unversioned/ingress.go index 88f8fc6ba6b..e874d044141 100644 --- a/pkg/client/unversioned/ingress.go +++ b/pkg/client/unversioned/ingress.go @@ -37,7 +37,7 @@ type IngressInterface interface { Create(ingress *extensions.Ingress) (*extensions.Ingress, error) Update(ingress *extensions.Ingress) (*extensions.Ingress, error) Delete(name string, options *api.DeleteOptions) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) } @@ -94,14 +94,12 @@ func (c *ingress) Delete(name string, options *api.DeleteOptions) (err error) { } // Watch returns a watch.Interface that watches the requested ingress. -func (c *ingress) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *ingress) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/jobs.go b/pkg/client/unversioned/jobs.go index 878adb72924..2181eee8cfa 100644 --- a/pkg/client/unversioned/jobs.go +++ b/pkg/client/unversioned/jobs.go @@ -38,7 +38,7 @@ type JobInterface interface { Create(job *extensions.Job) (*extensions.Job, error) Update(job *extensions.Job) (*extensions.Job, error) Delete(name string, options *api.DeleteOptions) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) UpdateStatus(job *extensions.Job) (*extensions.Job, error) } @@ -98,14 +98,12 @@ func (c *jobs) Delete(name string, options *api.DeleteOptions) (err error) { } // Watch returns a watch.Interface that watches the requested jobs. -func (c *jobs) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *jobs) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("jobs"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/limit_ranges.go b/pkg/client/unversioned/limit_ranges.go index e48a36eec8d..5ab4959baec 100644 --- a/pkg/client/unversioned/limit_ranges.go +++ b/pkg/client/unversioned/limit_ranges.go @@ -38,7 +38,7 @@ type LimitRangeInterface interface { Delete(name string) error Create(limitRange *api.LimitRange) (*api.LimitRange, error) Update(limitRange *api.LimitRange) (*api.LimitRange, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // limitRanges implements LimitRangesNamespacer interface @@ -93,13 +93,11 @@ func (c *limitRanges) Update(limitRange *api.LimitRange) (result *api.LimitRange } // Watch returns a watch.Interface that watches the requested resource -func (c *limitRanges) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *limitRanges) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("limitRanges"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/limit_ranges_test.go b/pkg/client/unversioned/limit_ranges_test.go index 439faeae6e9..d872101da4d 100644 --- a/pkg/client/unversioned/limit_ranges_test.go +++ b/pkg/client/unversioned/limit_ranges_test.go @@ -208,6 +208,6 @@ func TestLimitRangeWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).LimitRanges(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).LimitRanges(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/namespaces.go b/pkg/client/unversioned/namespaces.go index b7891531fd0..2bedd5dc92c 100644 --- a/pkg/client/unversioned/namespaces.go +++ b/pkg/client/unversioned/namespaces.go @@ -36,7 +36,7 @@ type NamespaceInterface interface { List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error) Delete(name string) error Update(item *api.Namespace) (*api.Namespace, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) Finalize(item *api.Namespace) (*api.Namespace, error) Status(item *api.Namespace) (*api.Namespace, error) } @@ -116,12 +116,10 @@ func (c *namespaces) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested namespaces. -func (c *namespaces) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *namespaces) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Resource("namespaces"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/namespaces_test.go b/pkg/client/unversioned/namespaces_test.go index 927ae941791..3297e7190a2 100644 --- a/pkg/client/unversioned/namespaces_test.go +++ b/pkg/client/unversioned/namespaces_test.go @@ -175,6 +175,6 @@ func TestNamespaceWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).Namespaces().Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).Namespaces().Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/nodes.go b/pkg/client/unversioned/nodes.go index 6e36b35f30b..57590f47eef 100644 --- a/pkg/client/unversioned/nodes.go +++ b/pkg/client/unversioned/nodes.go @@ -37,7 +37,7 @@ type NodeInterface interface { Delete(name string) error Update(*api.Node) (*api.Node, error) UpdateStatus(*api.Node) (*api.Node, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // nodes implements NodesInterface @@ -103,13 +103,11 @@ func (c *nodes) UpdateStatus(node *api.Node) (*api.Node, error) { } // Watch returns a watch.Interface that watches the requested nodes. -func (c *nodes) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *nodes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(api.NamespaceAll). Resource(c.resourceName()). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/persistentvolume_test.go b/pkg/client/unversioned/persistentvolume_test.go index 8eacae09b99..fb394ea7911 100644 --- a/pkg/client/unversioned/persistentvolume_test.go +++ b/pkg/client/unversioned/persistentvolume_test.go @@ -181,6 +181,6 @@ func TestPersistentVolumeWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).PersistentVolumes().Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).PersistentVolumes().Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/persistentvolumeclaim.go b/pkg/client/unversioned/persistentvolumeclaim.go index 16601a0eb6d..3b2061d34d1 100644 --- a/pkg/client/unversioned/persistentvolumeclaim.go +++ b/pkg/client/unversioned/persistentvolumeclaim.go @@ -39,7 +39,7 @@ type PersistentVolumeClaimInterface interface { Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Delete(name string) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // persistentVolumeClaims implements PersistentVolumeClaimsNamespacer interface @@ -100,13 +100,11 @@ func (c *persistentVolumeClaims) Delete(name string) error { return c.client.Delete().Namespace(c.namespace).Resource("persistentVolumeClaims").Name(name).Do().Error() } -func (c *persistentVolumeClaims) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *persistentVolumeClaims) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.namespace). Resource("persistentVolumeClaims"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/persistentvolumeclaim_test.go b/pkg/client/unversioned/persistentvolumeclaim_test.go index fb6e18ad6c2..8afb843e367 100644 --- a/pkg/client/unversioned/persistentvolumeclaim_test.go +++ b/pkg/client/unversioned/persistentvolumeclaim_test.go @@ -198,6 +198,6 @@ func TestPersistentVolumeClaimWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).PersistentVolumeClaims(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).PersistentVolumeClaims(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/persistentvolumes.go b/pkg/client/unversioned/persistentvolumes.go index 87899699b9a..5f6e578a478 100644 --- a/pkg/client/unversioned/persistentvolumes.go +++ b/pkg/client/unversioned/persistentvolumes.go @@ -38,7 +38,7 @@ type PersistentVolumeInterface interface { Update(volume *api.PersistentVolume) (*api.PersistentVolume, error) UpdateStatus(persistentVolume *api.PersistentVolume) (*api.PersistentVolume, error) Delete(name string) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // persistentVolumes implements PersistentVolumesInterface @@ -95,12 +95,10 @@ func (c *persistentVolumes) Delete(name string) error { return c.client.Delete().Resource("persistentVolumes").Name(name).Do().Error() } -func (c *persistentVolumes) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *persistentVolumes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Resource("persistentVolumes"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/pod_templates.go b/pkg/client/unversioned/pod_templates.go index 6435b12e871..d90769baaca 100644 --- a/pkg/client/unversioned/pod_templates.go +++ b/pkg/client/unversioned/pod_templates.go @@ -36,7 +36,7 @@ type PodTemplateInterface interface { Delete(name string, options *api.DeleteOptions) error Create(podTemplate *api.PodTemplate) (*api.PodTemplate, error) Update(podTemplate *api.PodTemplate) (*api.PodTemplate, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // podTemplates implements PodTemplatesNamespacer interface @@ -95,13 +95,11 @@ func (c *podTemplates) Update(podTemplate *api.PodTemplate) (result *api.PodTemp } // Watch returns a watch.Interface that watches the requested podTemplates. -func (c *podTemplates) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *podTemplates) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("podTemplates"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/pod_templates_test.go b/pkg/client/unversioned/pod_templates_test.go index ec80ed203a6..c6c143e5b62 100644 --- a/pkg/client/unversioned/pod_templates_test.go +++ b/pkg/client/unversioned/pod_templates_test.go @@ -138,6 +138,6 @@ func TestPodTemplateWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).PodTemplates(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).PodTemplates(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/pods.go b/pkg/client/unversioned/pods.go index f1ef4a11202..d093b991b4c 100644 --- a/pkg/client/unversioned/pods.go +++ b/pkg/client/unversioned/pods.go @@ -36,7 +36,7 @@ type PodInterface interface { Delete(name string, options *api.DeleteOptions) error Create(pod *api.Pod) (*api.Pod, error) Update(pod *api.Pod) (*api.Pod, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) Bind(binding *api.Binding) error UpdateStatus(pod *api.Pod) (*api.Pod, error) GetLogs(name string, opts *api.PodLogOptions) *Request @@ -98,14 +98,12 @@ func (c *pods) Update(pod *api.Pod) (result *api.Pod, err error) { } // Watch returns a watch.Interface that watches the requested pods. -func (c *pods) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *pods) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("pods"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/replication_controllers.go b/pkg/client/unversioned/replication_controllers.go index 36355ca2fdd..b283c8c47b6 100644 --- a/pkg/client/unversioned/replication_controllers.go +++ b/pkg/client/unversioned/replication_controllers.go @@ -37,7 +37,7 @@ type ReplicationControllerInterface interface { Update(ctrl *api.ReplicationController) (*api.ReplicationController, error) UpdateStatus(ctrl *api.ReplicationController) (*api.ReplicationController, error) Delete(name string) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // replicationControllers implements ReplicationControllersNamespacer interface @@ -92,13 +92,11 @@ func (c *replicationControllers) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested controllers. -func (c *replicationControllers) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *replicationControllers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("replicationControllers"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/resource_quotas.go b/pkg/client/unversioned/resource_quotas.go index 084ca46bf26..22f31d1f4a8 100644 --- a/pkg/client/unversioned/resource_quotas.go +++ b/pkg/client/unversioned/resource_quotas.go @@ -37,7 +37,7 @@ type ResourceQuotaInterface interface { Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // resourceQuotas implements ResourceQuotasNamespacer interface @@ -95,13 +95,11 @@ func (c *resourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (result } // Watch returns a watch.Interface that watches the requested resource -func (c *resourceQuotas) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *resourceQuotas) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("resourceQuotas"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/resource_quotas_test.go b/pkg/client/unversioned/resource_quotas_test.go index c36d9715ec1..8dfd5f6ef25 100644 --- a/pkg/client/unversioned/resource_quotas_test.go +++ b/pkg/client/unversioned/resource_quotas_test.go @@ -194,6 +194,6 @@ func TestResourceQuotaWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: Response{StatusCode: 200}, } - _, err := c.Setup(t).ResourceQuotas(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + _, err := c.Setup(t).ResourceQuotas(api.NamespaceAll).Watch(unversioned.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/secrets.go b/pkg/client/unversioned/secrets.go index a1e22a27b1d..362caf51971 100644 --- a/pkg/client/unversioned/secrets.go +++ b/pkg/client/unversioned/secrets.go @@ -34,7 +34,7 @@ type SecretsInterface interface { Delete(name string) error List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error) Get(name string) (*api.Secret, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // events implements Secrets interface @@ -93,14 +93,12 @@ func (s *secrets) Get(name string) (*api.Secret, error) { } // Watch starts watching for secrets matching the given selectors. -func (s *secrets) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (s *secrets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return s.client.Get(). Prefix("watch"). Namespace(s.namespace). Resource("secrets"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/service_accounts.go b/pkg/client/unversioned/service_accounts.go index 3eda2d3fb6c..a17a0f3ef0e 100644 --- a/pkg/client/unversioned/service_accounts.go +++ b/pkg/client/unversioned/service_accounts.go @@ -34,7 +34,7 @@ type ServiceAccountsInterface interface { Delete(name string) error List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) Get(name string) (*api.ServiceAccount, error) - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) } // serviceAccounts implements ServiceAccounts interface @@ -93,14 +93,12 @@ func (s *serviceAccounts) Get(name string) (*api.ServiceAccount, error) { } // Watch starts watching for serviceAccounts matching the given selectors. -func (s *serviceAccounts) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (s *serviceAccounts) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return s.client.Get(). Prefix("watch"). Namespace(s.namespace). Resource("serviceAccounts"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/services.go b/pkg/client/unversioned/services.go index 96ebce923b7..ab9ab501ced 100644 --- a/pkg/client/unversioned/services.go +++ b/pkg/client/unversioned/services.go @@ -37,7 +37,7 @@ type ServiceInterface interface { Create(srv *api.Service) (*api.Service, error) Update(srv *api.Service) (*api.Service, error) Delete(name string) error - Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts unversioned.ListOptions) (watch.Interface, error) ProxyGet(scheme, name, port, path string, params map[string]string) ResponseWrapper } @@ -93,14 +93,12 @@ func (c *services) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested services. -func (c *services) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (c *services) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). Resource("services"). VersionedParams(&opts, api.Scheme). - LabelsSelectorParam(label). - FieldsSelectorParam(field). Watch() } diff --git a/pkg/client/unversioned/testclient/actions.go b/pkg/client/unversioned/testclient/actions.go index 38ef9098930..546780d724b 100644 --- a/pkg/client/unversioned/testclient/actions.go +++ b/pkg/client/unversioned/testclient/actions.go @@ -150,21 +150,37 @@ func NewDeleteAction(resource, namespace, name string) DeleteActionImpl { return action } -func NewRootWatchAction(resource string, label labels.Selector, field fields.Selector, opts unversioned.ListOptions) WatchActionImpl { +func NewRootWatchAction(resource string, opts unversioned.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource - action.WatchRestrictions = WatchRestrictions{label, field, opts.ResourceVersion} + labelSelector := opts.LabelSelector.Selector + if labelSelector == nil { + labelSelector = labels.Everything() + } + fieldSelector := opts.FieldSelector.Selector + if fieldSelector == nil { + fieldSelector = fields.Everything() + } + action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, opts.ResourceVersion} return action } -func NewWatchAction(resource, namespace string, label labels.Selector, field fields.Selector, opts unversioned.ListOptions) WatchActionImpl { +func NewWatchAction(resource, namespace string, opts unversioned.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource action.Namespace = namespace - action.WatchRestrictions = WatchRestrictions{label, field, opts.ResourceVersion} + labelSelector := opts.LabelSelector.Selector + if labelSelector == nil { + labelSelector = labels.Everything() + } + fieldSelector := opts.FieldSelector.Selector + if fieldSelector == nil { + fieldSelector = fields.Everything() + } + action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, opts.ResourceVersion} return action } diff --git a/pkg/client/unversioned/testclient/fake_daemon_sets.go b/pkg/client/unversioned/testclient/fake_daemon_sets.go index d5dc193c10c..7c764e34d0f 100644 --- a/pkg/client/unversioned/testclient/fake_daemon_sets.go +++ b/pkg/client/unversioned/testclient/fake_daemon_sets.go @@ -80,6 +80,6 @@ func (c *FakeDaemonSets) Delete(name string) error { return err } -func (c *FakeDaemonSets) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("daemonsets", c.Namespace, label, field, opts)) +func (c *FakeDaemonSets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("daemonsets", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_deployments.go b/pkg/client/unversioned/testclient/fake_deployments.go index 25b815187bf..f666ac09b8d 100644 --- a/pkg/client/unversioned/testclient/fake_deployments.go +++ b/pkg/client/unversioned/testclient/fake_deployments.go @@ -87,6 +87,6 @@ func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error return err } -func (c *FakeDeployments) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("deployments", c.Namespace, label, field, opts)) +func (c *FakeDeployments) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("deployments", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_endpoints.go b/pkg/client/unversioned/testclient/fake_endpoints.go index 4f9faef7c1b..3617108cdc7 100644 --- a/pkg/client/unversioned/testclient/fake_endpoints.go +++ b/pkg/client/unversioned/testclient/fake_endpoints.go @@ -72,6 +72,6 @@ func (c *FakeEndpoints) Delete(name string) error { return err } -func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("endpoints", c.Namespace, label, field, opts)) +func (c *FakeEndpoints) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("endpoints", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_events.go b/pkg/client/unversioned/testclient/fake_events.go index 33350f792f8..7d32386360f 100644 --- a/pkg/client/unversioned/testclient/fake_events.go +++ b/pkg/client/unversioned/testclient/fake_events.go @@ -112,10 +112,10 @@ func (c *FakeEvents) Delete(name string) error { } // Watch starts watching for events matching the given selectors. -func (c *FakeEvents) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - action := NewRootWatchAction("events", label, field, opts) +func (c *FakeEvents) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + action := NewRootWatchAction("events", opts) if c.Namespace != "" { - action = NewWatchAction("events", c.Namespace, label, field, opts) + action = NewWatchAction("events", c.Namespace, opts) } return c.Fake.InvokesWatch(action) } diff --git a/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go b/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go index 955eb830603..7c481f8fb36 100644 --- a/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go +++ b/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go @@ -86,6 +86,6 @@ func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOp return err } -func (c *FakeHorizontalPodAutoscalers) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("horizontalpodautoscalers", c.Namespace, label, field, opts)) +func (c *FakeHorizontalPodAutoscalers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("horizontalpodautoscalers", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_ingress.go b/pkg/client/unversioned/testclient/fake_ingress.go index 27fd2db3957..fe7bade567d 100644 --- a/pkg/client/unversioned/testclient/fake_ingress.go +++ b/pkg/client/unversioned/testclient/fake_ingress.go @@ -73,8 +73,8 @@ func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakeIngress) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("ingresses", c.Namespace, label, field, opts)) +func (c *FakeIngress) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("ingresses", c.Namespace, opts)) } func (c *FakeIngress) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) { diff --git a/pkg/client/unversioned/testclient/fake_jobs.go b/pkg/client/unversioned/testclient/fake_jobs.go index 8fb6d3cd947..79b2e5f5ecd 100644 --- a/pkg/client/unversioned/testclient/fake_jobs.go +++ b/pkg/client/unversioned/testclient/fake_jobs.go @@ -73,8 +73,8 @@ func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakeJobs) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("jobs", c.Namespace, label, field, opts)) +func (c *FakeJobs) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("jobs", c.Namespace, opts)) } func (c *FakeJobs) UpdateStatus(job *extensions.Job) (result *extensions.Job, err error) { diff --git a/pkg/client/unversioned/testclient/fake_limit_ranges.go b/pkg/client/unversioned/testclient/fake_limit_ranges.go index f7c65e47a2b..8986d766171 100644 --- a/pkg/client/unversioned/testclient/fake_limit_ranges.go +++ b/pkg/client/unversioned/testclient/fake_limit_ranges.go @@ -72,6 +72,6 @@ func (c *FakeLimitRanges) Delete(name string) error { return err } -func (c *FakeLimitRanges) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("limitranges", c.Namespace, label, field, opts)) +func (c *FakeLimitRanges) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("limitranges", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_namespaces.go b/pkg/client/unversioned/testclient/fake_namespaces.go index 53035bc4ad5..0a55f796c87 100644 --- a/pkg/client/unversioned/testclient/fake_namespaces.go +++ b/pkg/client/unversioned/testclient/fake_namespaces.go @@ -71,8 +71,8 @@ func (c *FakeNamespaces) Delete(name string) error { return err } -func (c *FakeNamespaces) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewRootWatchAction("namespaces", label, field, opts)) +func (c *FakeNamespaces) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewRootWatchAction("namespaces", opts)) } func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error) { diff --git a/pkg/client/unversioned/testclient/fake_nodes.go b/pkg/client/unversioned/testclient/fake_nodes.go index 3efd216b410..eccd5756084 100644 --- a/pkg/client/unversioned/testclient/fake_nodes.go +++ b/pkg/client/unversioned/testclient/fake_nodes.go @@ -71,8 +71,8 @@ func (c *FakeNodes) Delete(name string) error { return err } -func (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewRootWatchAction("nodes", label, field, opts)) +func (c *FakeNodes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewRootWatchAction("nodes", opts)) } func (c *FakeNodes) UpdateStatus(node *api.Node) (*api.Node, error) { diff --git a/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go b/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go index e7c94a55825..055a51538e1 100644 --- a/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go +++ b/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go @@ -70,8 +70,8 @@ func (c *FakePersistentVolumeClaims) Delete(name string) error { return err } -func (c *FakePersistentVolumeClaims) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("persistentvolumeclaims", c.Namespace, label, field, opts)) +func (c *FakePersistentVolumeClaims) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("persistentvolumeclaims", c.Namespace, opts)) } func (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) { diff --git a/pkg/client/unversioned/testclient/fake_persistent_volumes.go b/pkg/client/unversioned/testclient/fake_persistent_volumes.go index b728ac4f518..79f365902d9 100644 --- a/pkg/client/unversioned/testclient/fake_persistent_volumes.go +++ b/pkg/client/unversioned/testclient/fake_persistent_volumes.go @@ -69,8 +69,8 @@ func (c *FakePersistentVolumes) Delete(name string) error { return err } -func (c *FakePersistentVolumes) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewRootWatchAction("persistentvolumes", label, field, opts)) +func (c *FakePersistentVolumes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewRootWatchAction("persistentvolumes", opts)) } func (c *FakePersistentVolumes) UpdateStatus(pv *api.PersistentVolume) (*api.PersistentVolume, error) { diff --git a/pkg/client/unversioned/testclient/fake_pod_templates.go b/pkg/client/unversioned/testclient/fake_pod_templates.go index 989fad7f58b..3d6a42d28a7 100644 --- a/pkg/client/unversioned/testclient/fake_pod_templates.go +++ b/pkg/client/unversioned/testclient/fake_pod_templates.go @@ -72,6 +72,6 @@ func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error return err } -func (c *FakePodTemplates) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("podtemplates", c.Namespace, label, field, opts)) +func (c *FakePodTemplates) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("podtemplates", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_pods.go b/pkg/client/unversioned/testclient/fake_pods.go index 6fe9633eb12..996ddbe1ae0 100644 --- a/pkg/client/unversioned/testclient/fake_pods.go +++ b/pkg/client/unversioned/testclient/fake_pods.go @@ -78,8 +78,8 @@ func (c *FakePods) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakePods) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("pods", c.Namespace, label, field, opts)) +func (c *FakePods) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("pods", c.Namespace, opts)) } func (c *FakePods) Bind(binding *api.Binding) error { diff --git a/pkg/client/unversioned/testclient/fake_replication_controllers.go b/pkg/client/unversioned/testclient/fake_replication_controllers.go index d709383db7a..c9ceec1d3ff 100644 --- a/pkg/client/unversioned/testclient/fake_replication_controllers.go +++ b/pkg/client/unversioned/testclient/fake_replication_controllers.go @@ -80,6 +80,6 @@ func (c *FakeReplicationControllers) Delete(name string) error { return err } -func (c *FakeReplicationControllers) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("replicationcontrollers", c.Namespace, label, field, opts)) +func (c *FakeReplicationControllers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("replicationcontrollers", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_resource_quotas.go b/pkg/client/unversioned/testclient/fake_resource_quotas.go index 1711e36c08c..405ecdad1fe 100644 --- a/pkg/client/unversioned/testclient/fake_resource_quotas.go +++ b/pkg/client/unversioned/testclient/fake_resource_quotas.go @@ -72,8 +72,8 @@ func (c *FakeResourceQuotas) Delete(name string) error { return err } -func (c *FakeResourceQuotas) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("resourcequotas", c.Namespace, label, field, opts)) +func (c *FakeResourceQuotas) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("resourcequotas", c.Namespace, opts)) } func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) { diff --git a/pkg/client/unversioned/testclient/fake_secrets.go b/pkg/client/unversioned/testclient/fake_secrets.go index 5321507b5d1..afdfc91a9c6 100644 --- a/pkg/client/unversioned/testclient/fake_secrets.go +++ b/pkg/client/unversioned/testclient/fake_secrets.go @@ -72,6 +72,6 @@ func (c *FakeSecrets) Delete(name string) error { return err } -func (c *FakeSecrets) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("secrets", c.Namespace, label, field, opts)) +func (c *FakeSecrets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("secrets", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_service_accounts.go b/pkg/client/unversioned/testclient/fake_service_accounts.go index e2baaafaa1b..e9e10abeb9d 100644 --- a/pkg/client/unversioned/testclient/fake_service_accounts.go +++ b/pkg/client/unversioned/testclient/fake_service_accounts.go @@ -72,6 +72,6 @@ func (c *FakeServiceAccounts) Delete(name string) error { return err } -func (c *FakeServiceAccounts) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("serviceaccounts", c.Namespace, label, field, opts)) +func (c *FakeServiceAccounts) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("serviceaccounts", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_services.go b/pkg/client/unversioned/testclient/fake_services.go index bc5de77e18f..373a97baa28 100644 --- a/pkg/client/unversioned/testclient/fake_services.go +++ b/pkg/client/unversioned/testclient/fake_services.go @@ -73,8 +73,8 @@ func (c *FakeServices) Delete(name string) error { return err } -func (c *FakeServices) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(NewWatchAction("services", c.Namespace, label, field, opts)) +func (c *FakeServices) Watch(opts unversioned.ListOptions) (watch.Interface, error) { + return c.Fake.InvokesWatch(NewWatchAction("services", c.Namespace, opts)) } func (c *FakeServices) ProxyGet(scheme, name, port, path string, params map[string]string) client.ResponseWrapper { diff --git a/pkg/controller/daemon/controller.go b/pkg/controller/daemon/controller.go index 20faccaafcc..03b64be5c76 100644 --- a/pkg/controller/daemon/controller.go +++ b/pkg/controller/daemon/controller.go @@ -101,7 +101,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &extensions.DaemonSet{}, @@ -133,7 +133,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle return dsc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, @@ -151,7 +151,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle return dsc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return dsc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options) + return dsc.kubeClient.Nodes().Watch(options) }, }, &api.Node{}, diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index f7367dac59f..e1437043de7 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -67,7 +67,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Service{}, @@ -88,7 +88,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, diff --git a/pkg/controller/gc/gc_controller.go b/pkg/controller/gc/gc_controller.go index 31de37dd887..64e38cd6eaf 100644 --- a/pkg/controller/gc/gc_controller.go +++ b/pkg/controller/gc/gc_controller.go @@ -70,7 +70,8 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc, return gcc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), terminatedSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return gcc.kubeClient.Pods(api.NamespaceAll).Watch(labels.Everything(), terminatedSelector, options) + options.FieldSelector.Selector = terminatedSelector + return gcc.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, &api.Pod{}, diff --git a/pkg/controller/job/controller.go b/pkg/controller/job/controller.go index 04370ee3227..7e724d4554b 100644 --- a/pkg/controller/job/controller.go +++ b/pkg/controller/job/controller.go @@ -89,7 +89,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &extensions.Job{}, @@ -112,7 +112,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn return jm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index abc6c6af0c1..8d9fc619baf 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -51,7 +51,7 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A return kubeClient.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return kubeClient.Namespaces().Watch(labels.Everything(), fields.Everything(), options) + return kubeClient.Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go index 6c4970b7c3c..afd6d4b0694 100644 --- a/pkg/controller/node/nodecontroller.go +++ b/pkg/controller/node/nodecontroller.go @@ -167,7 +167,7 @@ func NewNodeController( return nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, @@ -183,7 +183,7 @@ func NewNodeController( return nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return nc.kubeClient.Nodes().Watch(labels.Everything(), fields.Everything(), options) + return nc.kubeClient.Nodes().Watch(options) }, }, &api.Node{}, diff --git a/pkg/controller/node/nodecontroller_test.go b/pkg/controller/node/nodecontroller_test.go index 5b6a27fbb5c..0efd188d623 100644 --- a/pkg/controller/node/nodecontroller_test.go +++ b/pkg/controller/node/nodecontroller_test.go @@ -136,7 +136,7 @@ func (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error) { return node, nil } -func (m *FakeNodeHandler) Watch(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (watch.Interface, error) { +func (m *FakeNodeHandler) Watch(opts unversioned.ListOptions) (watch.Interface, error) { return nil, nil } diff --git a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go index 3eb6c302e43..4bcf9a90a3c 100644 --- a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go @@ -61,7 +61,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options) + return kubeClient.PersistentVolumes().Watch(options) }, }, &api.PersistentVolume{}, @@ -79,7 +79,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.PersistentVolumeClaim{}, diff --git a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go index ad6d404b629..1e8a5435c8f 100644 --- a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go @@ -68,7 +68,7 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return kubeClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), options) + return kubeClient.PersistentVolumes().Watch(options) }, }, &api.PersistentVolume{}, diff --git a/pkg/controller/replication/replication_controller.go b/pkg/controller/replication/replication_controller.go index 192f01904bd..78374768f4c 100644 --- a/pkg/controller/replication/replication_controller.go +++ b/pkg/controller/replication/replication_controller.go @@ -112,7 +112,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller. return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.ReplicationController{}, @@ -153,7 +153,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller. return rm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.Pod{}, diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller.go b/pkg/controller/serviceaccount/serviceaccounts_controller.go index d6d6ea79529..e0f507f6f0d 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller.go @@ -82,7 +82,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), accountSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return e.client.ServiceAccounts(api.NamespaceAll).Watch(labels.Everything(), accountSelector, options) + options.FieldSelector.Selector = accountSelector + return e.client.ServiceAccounts(api.NamespaceAll).Watch(options) }, }, &api.ServiceAccount{}, @@ -99,7 +100,7 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo return e.client.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return e.client.Namespaces().Watch(labels.Everything(), fields.Everything(), options) + return e.client.Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/pkg/controller/serviceaccount/tokens_controller.go b/pkg/controller/serviceaccount/tokens_controller.go index f5649bcbd07..a2605210c8a 100644 --- a/pkg/controller/serviceaccount/tokens_controller.go +++ b/pkg/controller/serviceaccount/tokens_controller.go @@ -67,7 +67,7 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.ServiceAccount{}, @@ -87,7 +87,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * return e.client.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return e.client.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options) + options.FieldSelector.Selector = tokenSelector + return e.client.Secrets(api.NamespaceAll).Watch(options) }, }, &api.Secret{}, diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index e841706e54e..4f9a11ca698 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -240,7 +240,7 @@ func NewMainKubelet( return kubeClient.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, } cache.NewReflector(listWatch, &api.Service{}, serviceStore, 0).Run() @@ -257,7 +257,8 @@ func NewMainKubelet( return kubeClient.Nodes().List(labels.Everything(), fieldSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return kubeClient.Nodes().Watch(labels.Everything(), fieldSelector, options) + options.FieldSelector.Selector = fieldSelector + return kubeClient.Nodes().Watch(options) }, } cache.NewReflector(listWatch, &api.Node{}, nodeStore, 0).Run() diff --git a/pkg/volume/util.go b/pkg/volume/util.go index f3937ce7502..4d04a6d702a 100644 --- a/pkg/volume/util.go +++ b/pkg/volume/util.go @@ -113,7 +113,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s return c.client.Pods(namespace).List(labels.Everything(), fieldSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.client.Pods(namespace).Watch(labels.Everything(), fieldSelector, options) + options.FieldSelector.Selector = fieldSelector + return c.client.Pods(namespace).Watch(options) }, } queue := cache.NewFIFO(cache.MetaNamespaceKeyFunc) diff --git a/plugin/pkg/admission/limitranger/admission.go b/plugin/pkg/admission/limitranger/admission.go index 112cbd2ce47..c9df30fef39 100644 --- a/plugin/pkg/admission/limitranger/admission.go +++ b/plugin/pkg/admission/limitranger/admission.go @@ -104,7 +104,7 @@ func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Inte return client.LimitRanges(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, } indexer, reflector := cache.NewNamespaceKeyedIndexerAndReflector(lw, &api.LimitRange{}, 0) diff --git a/plugin/pkg/admission/namespace/autoprovision/admission.go b/plugin/pkg/admission/namespace/autoprovision/admission.go index 201ba0e67b1..c99fc931784 100644 --- a/plugin/pkg/admission/namespace/autoprovision/admission.go +++ b/plugin/pkg/admission/namespace/autoprovision/admission.go @@ -89,7 +89,7 @@ func NewProvision(c client.Interface) admission.Interface { return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) + return c.Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/plugin/pkg/admission/namespace/exists/admission.go b/plugin/pkg/admission/namespace/exists/admission.go index bedb531137d..7098d0b3d95 100644 --- a/plugin/pkg/admission/namespace/exists/admission.go +++ b/plugin/pkg/admission/namespace/exists/admission.go @@ -96,7 +96,7 @@ func NewExists(c client.Interface) admission.Interface { return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) + return c.Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/plugin/pkg/admission/namespace/lifecycle/admission.go b/plugin/pkg/admission/namespace/lifecycle/admission.go index 736cc1464af..be20ce96436 100644 --- a/plugin/pkg/admission/namespace/lifecycle/admission.go +++ b/plugin/pkg/admission/namespace/lifecycle/admission.go @@ -113,7 +113,7 @@ func NewLifecycle(c client.Interface) admission.Interface { return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Namespaces().Watch(labels.Everything(), fields.Everything(), options) + return c.Namespaces().Watch(options) }, }, &api.Namespace{}, diff --git a/plugin/pkg/admission/resourcequota/admission.go b/plugin/pkg/admission/resourcequota/admission.go index d544ead8893..cf1e53a51f1 100644 --- a/plugin/pkg/admission/resourcequota/admission.go +++ b/plugin/pkg/admission/resourcequota/admission.go @@ -55,7 +55,7 @@ func NewResourceQuota(client client.Interface) admission.Interface { return client.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, } indexer, reflector := cache.NewNamespaceKeyedIndexerAndReflector(lw, &api.ResourceQuota{}, 0) diff --git a/plugin/pkg/admission/serviceaccount/admission.go b/plugin/pkg/admission/serviceaccount/admission.go index d66655a650f..459cc8e67f1 100644 --- a/plugin/pkg/admission/serviceaccount/admission.go +++ b/plugin/pkg/admission/serviceaccount/admission.go @@ -87,7 +87,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount { return cl.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, 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(options) }, }, &api.ServiceAccount{}, @@ -101,7 +101,8 @@ func NewServiceAccount(cl client.Interface) *serviceAccount { return cl.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return cl.Secrets(api.NamespaceAll).Watch(labels.Everything(), tokenSelector, options) + options.FieldSelector.Selector = tokenSelector + return cl.Secrets(api.NamespaceAll).Watch(options) }, }, &api.Secret{}, diff --git a/test/e2e/daemon_restart.go b/test/e2e/daemon_restart.go index 175b515765a..4e99936d328 100644 --- a/test/e2e/daemon_restart.go +++ b/test/e2e/daemon_restart.go @@ -224,7 +224,8 @@ var _ = Describe("DaemonRestart", func() { return framework.Client.Pods(ns).List(labelSelector, fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return framework.Client.Pods(ns).Watch(labelSelector, fields.Everything(), options) + options.LabelSelector.Selector = labelSelector + return framework.Client.Pods(ns).Watch(options) }, }, &api.Pod{}, diff --git a/test/e2e/density.go b/test/e2e/density.go index db4022a4b97..a7a4d155760 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -237,7 +237,7 @@ var _ = Describe("Density [Skipped]", func() { return c.Events(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Events(ns).Watch(labels.Everything(), fields.Everything(), options) + return c.Events(ns).Watch(options) }, }, &api.Event{}, @@ -320,7 +320,8 @@ var _ = Describe("Density [Skipped]", func() { return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options) + options.LabelSelector.Selector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) + return c.Pods(ns).Watch(options) }, }, &api.Pod{}, diff --git a/test/e2e/framework.go b/test/e2e/framework.go index b7c7e24d24a..8d42fac41c8 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -199,11 +199,11 @@ func (f *Framework) WaitForAnEndpoint(serviceName string) error { } } - w, err := f.Client.Endpoints(f.Namespace.Name).Watch( - labels.Everything(), - fields.Set{"metadata.name": serviceName}.AsSelector(), - unversioned.ListOptions{ResourceVersion: rv}, - ) + options := unversioned.ListOptions{ + FieldSelector: unversioned.FieldSelector{fields.Set{"metadata.name": serviceName}.AsSelector()}, + ResourceVersion: rv, + } + w, err := f.Client.Endpoints(f.Namespace.Name).Watch(options) if err != nil { return err } diff --git a/test/e2e/latency.go b/test/e2e/latency.go index d9d63f49090..4b32e698362 100644 --- a/test/e2e/latency.go +++ b/test/e2e/latency.go @@ -147,7 +147,8 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) { return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options) + options.LabelSelector.Selector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) + return c.Pods(ns).Watch(options) }, }, &api.Pod{}, diff --git a/test/e2e/pods.go b/test/e2e/pods.go index 744cfc43e97..f12b04a7a26 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -305,9 +305,11 @@ var _ = Describe("Pods", func() { Failf("Failed to query for pods: %v", err) } Expect(len(pods.Items)).To(Equal(0)) - w, err := podClient.Watch( - labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything(), - unversioned.ListOptions{ResourceVersion: pods.ListMeta.ResourceVersion}) + options := unversioned.ListOptions{ + LabelSelector: unversioned.LabelSelector{labels.SelectorFromSet(labels.Set(map[string]string{"time": value}))}, + ResourceVersion: pods.ListMeta.ResourceVersion, + } + w, err := podClient.Watch(options) if err != nil { Failf("Failed to set up watch: %v", err) } diff --git a/test/e2e/service_latency.go b/test/e2e/service_latency.go index c330a4a77cd..9203ca7a6e7 100644 --- a/test/e2e/service_latency.go +++ b/test/e2e/service_latency.go @@ -283,7 +283,7 @@ func startEndpointWatcher(f *Framework, q *endpointQueries) { return f.Client.Endpoints(f.Namespace.Name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return f.Client.Endpoints(f.Namespace.Name).Watch(labels.Everything(), fields.Everything(), options) + return f.Client.Endpoints(f.Namespace.Name).Watch(options) }, }, &api.Endpoints{}, diff --git a/test/e2e/util.go b/test/e2e/util.go index 1997a4ab64f..ca61cd35720 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -165,7 +165,9 @@ func newPodStore(c *client.Client, namespace string, label labels.Selector, fiel return c.Pods(namespace).List(label, field, unversioned.ListOptions{}) }, WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - return c.Pods(namespace).Watch(label, field, options) + options.LabelSelector.Selector = label + options.FieldSelector.Selector = field + return c.Pods(namespace).Watch(options) }, } store := cache.NewStore(cache.MetaNamespaceKeyFunc) diff --git a/test/integration/client_test.go b/test/integration/client_test.go index 33742d78b93..c2e45ee0573 100644 --- a/test/integration/client_test.go +++ b/test/integration/client_test.go @@ -245,11 +245,11 @@ func TestMultiWatch(t *testing.T) { t.Fatalf("Couldn't make %v: %v", name, err) } go func(name, rv string) { - w, err := client.Pods(ns).Watch( - labels.Set{"watchlabel": name}.AsSelector(), - fields.Everything(), - unversioned.ListOptions{ResourceVersion: rv}, - ) + options := unversioned.ListOptions{ + LabelSelector: unversioned.LabelSelector{labels.Set{"watchlabel": name}.AsSelector()}, + ResourceVersion: rv, + } + w, err := client.Pods(ns).Watch(options) if err != nil { panic(fmt.Sprintf("watch error for %v: %v", name, err)) } diff --git a/test/integration/persistent_volumes_test.go b/test/integration/persistent_volumes_test.go index a9f1912a033..99dfdd21987 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -31,8 +31,6 @@ import ( client "k8s.io/kubernetes/pkg/client/unversioned" persistentvolumecontroller "k8s.io/kubernetes/pkg/controller/persistentvolume" "k8s.io/kubernetes/pkg/conversion" - "k8s.io/kubernetes/pkg/fields" - "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/test/integration/framework" @@ -78,7 +76,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { }, } - w, _ := testClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + w, _ := testClient.PersistentVolumes().Watch(unversioned.ListOptions{}) defer w.Stop() _, _ = testClient.PersistentVolumes().Create(pv) @@ -104,7 +102,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { // change the reclamation policy of the PV for the next test pv.Spec.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimDelete - w, _ = testClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), unversioned.ListOptions{}) + w, _ = testClient.PersistentVolumes().Watch(unversioned.ListOptions{}) defer w.Stop() _, _ = testClient.PersistentVolumes().Create(pv)