In this article
Preserve the initial LIST query and collection version through every chunk, and treat expiration recovery as a choice about consistency rather than a normal next page.
Build an inventory from one collection view
A research service inventories workload objects before explaining resource usage. Kubernetes’ API concepts support a large LIST response split into chunks with limit and continue. The collection’s resourceVersion remains consistent across the continued sequence. Objects changed after the initial view do not simply appear as fresh versions on later chunks, giving this operation a defined consistency contract.
Keep continuation attached to the initial query
The API field definitions require continuation from the returned token with otherwise identical query parameters. Preserve selectors and collection identity with the token. Changing the filter while carrying the old position is not an ordinary continuation of the original inventory. The token is server-defined; reconstructing it from the last visible object name discards the snapshot and query relationship it is meant to represent.
Use continue rather than page length as completion
Filtering can produce fewer items than the requested limit, including a chunk with no returned items while continuation remains available. The field contract tells clients to use continuation presence to determine whether more results exist. List metadata also describes remaining-item count as optional estimation, not an exact completeness condition. A short chunk or absent estimate should not silently terminate a supposedly complete resource inventory.
Handle expiration without mixing views
A token can expire and produce HTTP 410 with ResourceExpired semantics. The field definition distinguishes restarting for a consistent list from accepting an error-provided replacement token that continues from a newer snapshot. If consistency is required, restart the inventory and avoid treating earlier chunks as part of that fresh collection view. A replacement position may be useful under another policy, but the report must not claim one unchanged snapshot across the transition.
Retain collection-level evidence
Record the initial query, collection resourceVersion, chunk progression and recovery decision. Individual object resource versions describe those objects and should not substitute for the collection’s version. Task contracts establish whether a complete snapshot is required; tool observations show the collection actually read. This makes the final inventory’s completeness and consistency assessable without relying on item counts, client timing or a token that merely happened to remain decodable.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.