Merge pull request #15705 from wojtek-t/watch_options_in_client

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-10-24 17:39:20 -07:00
93 changed files with 12484 additions and 11582 deletions

View File

@@ -225,7 +225,8 @@ var _ = Describe("DaemonRestart", func() {
return framework.Client.Pods(ns).List(labelSelector, fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return framework.Client.Pods(ns).Watch(labelSelector, fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return framework.Client.Pods(ns).Watch(labelSelector, fields.Everything(), options)
},
},
&api.Pod{},

View File

@@ -203,7 +203,8 @@ var _ = Describe("Density", func() {
return c.Events(ns).List(labels.Everything(), fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return c.Events(ns).Watch(labels.Everything(), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return c.Events(ns).Watch(labels.Everything(), fields.Everything(), options)
},
},
&api.Event{},
@@ -286,7 +287,8 @@ var _ = Describe("Density", func() {
return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options)
},
},
&api.Pod{},

View File

@@ -153,7 +153,7 @@ func (f *Framework) WaitForAnEndpoint(serviceName string) error {
w, err := f.Client.Endpoints(f.Namespace.Name).Watch(
labels.Everything(),
fields.Set{"metadata.name": serviceName}.AsSelector(),
rv,
api.ListOptions{ResourceVersion: rv},
)
if err != nil {
return err

View File

@@ -153,7 +153,8 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) {
return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return c.Pods(ns).Watch(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), options)
},
},
&api.Pod{},

View File

@@ -304,7 +304,8 @@ var _ = Describe("Pods", func() {
}
Expect(len(pods.Items)).To(Equal(0))
w, err := podClient.Watch(
labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything(), pods.ListMeta.ResourceVersion)
labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything(),
api.ListOptions{ResourceVersion: pods.ListMeta.ResourceVersion})
if err != nil {
Failf("Failed to set up watch: %v", err)
}

View File

@@ -282,7 +282,8 @@ func startEndpointWatcher(f *Framework, q *endpointQueries) {
return f.Client.Endpoints(f.Namespace.Name).List(labels.Everything())
},
WatchFunc: func(rv string) (watch.Interface, error) {
return f.Client.Endpoints(f.Namespace.Name).Watch(labels.Everything(), fields.Everything(), rv)
options := api.ListOptions{ResourceVersion: rv}
return f.Client.Endpoints(f.Namespace.Name).Watch(labels.Everything(), fields.Everything(), options)
},
},
&api.Endpoints{},

View File

@@ -145,7 +145,8 @@ func newPodStore(c *client.Client, namespace string, label labels.Selector, fiel
return c.Pods(namespace).List(label, field)
},
WatchFunc: func(rv string) (watch.Interface, error) {
return c.Pods(namespace).Watch(label, field, rv)
options := api.ListOptions{ResourceVersion: rv}
return c.Pods(namespace).Watch(label, field, options)
},
}
store := cache.NewStore(cache.MetaNamespaceKeyFunc)

View File

@@ -247,7 +247,7 @@ func TestMultiWatch(t *testing.T) {
w, err := client.Pods(ns).Watch(
labels.Set{"watchlabel": name}.AsSelector(),
fields.Everything(),
rv,
api.ListOptions{ResourceVersion: rv},
)
if err != nil {
panic(fmt.Sprintf("watch error for %v: %v", name, err))

View File

@@ -74,7 +74,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
},
}
w, _ := testClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), "0")
w, _ := testClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), api.ListOptions{})
defer w.Stop()
_, _ = testClient.PersistentVolumes().Create(pv)
@@ -100,7 +100,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(), "0")
w, _ = testClient.PersistentVolumes().Watch(labels.Everything(), fields.Everything(), api.ListOptions{})
defer w.Stop()
_, _ = testClient.PersistentVolumes().Create(pv)