Skip to content

Commit 766285f

Browse files
ivelichkovichArangoGutierrez
authored andcommitted
add configurable pagination to nfd-gc
1 parent d2c17f6 commit 766285f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/nfd-gc/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ func initFlags(flagset *flag.FlagSet) *nfdgarbagecollector.Args {
8585
"Kubeconfig to use")
8686
flagset.IntVar(&args.Port, "port", 8080,
8787
"Port which metrics and healthz endpoints are served on")
88+
flagset.Int64Var(&args.ListSize, "list-size", 200,
89+
"the pagination size used when listing node features")
8890

8991
klog.InitFlags(flagset)
9092

pkg/nfd-gc/nfd-gc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type Args struct {
5252
GCPeriod time.Duration
5353
Kubeconfig string
5454
Port int
55+
ListSize int64
5556
}
5657

5758
type NfdGarbageCollector interface {
@@ -162,7 +163,7 @@ func (n *nfdGarbageCollector) garbageCollect() {
162163

163164
listAndHandle := func(gvr schema.GroupVersionResource, handler func(metav1.PartialObjectMetadata)) {
164165
opts := metav1.ListOptions{
165-
Limit: 200,
166+
Limit: n.args.ListSize,
166167
}
167168
for {
168169
rsp, err := n.client.Resource(gvr).List(context.TODO(), opts)

0 commit comments

Comments
 (0)