Skip to content

Commit

Permalink
feat: make cluster cache target the watch cache instead of etcd
Browse files Browse the repository at this point in the history
Signed-off-by: Antoni Zawodny <[email protected]>
  • Loading branch information
tosi3k committed Jul 25, 2024
1 parent 6b2984e commit 375f743
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cache/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ func (c *clusterCache) listResources(ctx context.Context, resClient dynamic.Reso
}

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

0 comments on commit 375f743

Please sign in to comment.