Skip to content

Commit

Permalink
Check generation to ensure index working on same object
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Mar 14, 2022
1 parent a74b910 commit e3e551f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cache/internal/cache_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (c *CacheReader) List(_ context.Context, out client.ObjectList, opts ...cli
for i := range list {
obj := list[i].(client.Object)
key := client.ObjectKey{Namespace: obj.GetNamespace(), Name: obj.GetName()}
if _, exists := objmap[key]; exists {
if o, exists := objmap[key]; exists && o.(client.Object).GetGeneration() == obj.GetGeneration() {
numap[key] = obj
}
}
Expand Down

0 comments on commit e3e551f

Please sign in to comment.