Files
client-go/tools
Odin Ugedal 4c9c7efdef client-go/cache: rewrite Replace to check queue first
This is useful to both reduce the code complexity, and to ensure clients
get the "newest" version of an object known when its deleted. This is
all best-effort, but for clients it makes more sense giving them the
newest object they observed rather than an old one.

This is especially useful when an object is recreated. eg.

Object A with key K is in the KnownObjects store;
- DELETE delta for A is queued with key K
- CREATE delta for B is queued with key K
- Replace without any object with key K in it.

In this situation its better to create a DELETE delta with
DeletedFinalStateUnknown with B (with this patch), than it is to give
the client an DeletedFinalStateUnknown with A (without this patch).

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 65034822ee9c4ff6f563108f2b8ba19bad60d809
2023-02-13 11:12:37 +00:00
..
2022-11-16 11:39:18 -05:00
2022-11-16 11:39:18 -05:00
2022-11-16 11:39:18 -05:00
2022-11-16 11:39:18 -05:00
2022-11-16 11:39:18 -05:00
2021-01-11 08:36:27 +00:00
2022-11-16 11:39:18 -05:00