mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Reuse TCP connections in Reflector between resync periods.
This commit is contained in:
@@ -150,10 +150,10 @@ func (f *FakeControllerSource) List() (runtime.Object, error) {
|
||||
|
||||
// Watch returns a watch, which will be pre-populated with all changes
|
||||
// after resourceVersion.
|
||||
func (f *FakeControllerSource) Watch(resourceVersion string) (watch.Interface, error) {
|
||||
func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, error) {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
rc, err := strconv.Atoi(resourceVersion)
|
||||
rc, err := strconv.Atoi(options.ResourceVersion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestRCNumber(t *testing.T) {
|
||||
source.Modify(pod("foo"))
|
||||
source.Modify(pod("foo"))
|
||||
|
||||
w, err := source.Watch("1")
|
||||
w, err := source.Watch(api.ListOptions{ResourceVersion: "1"})
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
@@ -78,13 +78,13 @@ func TestRCNumber(t *testing.T) {
|
||||
t.Errorf("wanted %v, got %v", e, a)
|
||||
}
|
||||
|
||||
w2, err := source.Watch("2")
|
||||
w2, err := source.Watch(api.ListOptions{ResourceVersion: "2"})
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
go consume(t, w2, []string{"3"}, wg)
|
||||
|
||||
w3, err := source.Watch("3")
|
||||
w3, err := source.Watch(api.ListOptions{ResourceVersion: "3"})
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user