Skip to content

Conversation

ryanpbrewster
Copy link

Motivation

When performing a List call, sometimes the API server will respond with an HTTP 410 for an inconsistentContinue token (defined here). The error body for that looks like

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    "continue": "<NEW_CONTINUE_TOKEN>"
  },
  "status": "Failure",
  "message": "The provided continue parameter is too old to display a consistent list result. You can start a new list without the continue parameter, or use the continue token in this response to retrieve the remainder of the results. Continuing with the provided token results in an inconsistent list - objects that were created, modified, or deleted between the time the first chunk was returned and now may show up in the list.",
  "reason": "Expired",
  "code": 410
}

I believe that clients are permitted to use that new continue token to continue their list operation if they're willing to tolerate inconsistent results.

I could not find a way to access that new continue token in the ErrorResponse from kube. This is my attempt to expose it in a fairly unstructured way.

Solution

This PR adds an optional metadata field to ErrorResponse. It should be backwards compatible.

@ryanpbrewster ryanpbrewster force-pushed the add-metadata-to-error branch 2 times, most recently from 5081efc to 8bbe5b6 Compare August 15, 2025 18:53
@ryanpbrewster ryanpbrewster force-pushed the add-metadata-to-error branch from 8bbe5b6 to 65438ca Compare August 15, 2025 18:57
@clux
Copy link
Member

clux commented Aug 20, 2025

Hey there, thanks for raising this! I think this is acceptable since the information is available right there, but the build has to be fixed in client/mod (where it needs to be default initialised in the degenerate case).

Ideally, this should be a proper ListMeta struct (as specified in the upstream struct docs) rather than inline json, but the same idea should work for that.

@clux clux added the changelog-add changelog added category for prs label Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants