Skip to content

Commit 375f743

Browse files
committed
feat: make cluster cache target the watch cache instead of etcd
Signed-off-by: Antoni Zawodny <[email protected]>
1 parent 6b2984e commit 375f743

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cache/cluster.go

+4
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ func (c *clusterCache) listResources(ctx context.Context, resClient dynamic.Reso
553553
}
554554

555555
listRetry.Steps = int(c.listRetryLimit)
556+
// We set the resource version to 0 below to proactively prevent the
557+
// list API call from reaching etcd and make the server fetch the data
558+
// from the watch cache instead.
559+
opts.ResourceVersion = "0"
556560
err := retry.OnError(listRetry, c.listRetryFunc, func() error {
557561
var ierr error
558562
res, ierr = resClient.List(ctx, opts)

0 commit comments

Comments
 (0)