concept

Informer cache and workqueues

A controller-runtime client may read through a cache while sending writes directly to the API server. A successful write is not a promise that the next cached read already contains it. For conflict-sensitive updates, use a suitably fresh read and retry with a newly fetched resourceVersion; do not assume resourceVersion is an integer counter that the application may increment. Recompute the intended change on each retry, and avoid overwriting fields owned by other actors.

Formal Syntax & Structure

kubernetes syntaxkubernetes
Read version A -> another writer changes object -> update returns 409Read fresh version B -> recompute -> attempt bounded update

Working Example

Example Snippetkubernetes
Read version A -> another writer changes object -> update returns 409Read fresh version B -> recompute -> attempt bounded update
Kubernetes Reference