Skip to content

Commit 1780792

Browse files
authored
Merge pull request kubernetes#86790 from wojtek-t/dumb_listwatch
Don't paginate in listwatch
2 parents ebdde7c + 51eb4b5 commit 1780792

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

staging/src/k8s.io/client-go/tools/cache/listwatch.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ limitations under the License.
1717
package cache
1818

1919
import (
20-
"context"
21-
2220
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2321
"k8s.io/apimachinery/pkg/fields"
2422
"k8s.io/apimachinery/pkg/runtime"
2523
"k8s.io/apimachinery/pkg/watch"
2624
restclient "k8s.io/client-go/rest"
27-
"k8s.io/client-go/tools/pager"
2825
)
2926

3027
// Lister is any object that knows how to perform an initial list.
@@ -102,9 +99,8 @@ func NewFilteredListWatchFromClient(c Getter, resource string, namespace string,
10299

103100
// List a set of apiserver resources
104101
func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) {
105-
if !lw.DisableChunking {
106-
return pager.New(pager.SimplePageFunc(lw.ListFunc)).List(context.TODO(), options)
107-
}
102+
// ListWatch is used in Reflector, which already supports pagination.
103+
// Don't paginate here to avoid duplication.
108104
return lw.ListFunc(options)
109105
}
110106

0 commit comments

Comments
 (0)