Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch events of type error can't be parsed #269

Open
jroper opened this issue May 1, 2019 · 3 comments
Open

Watch events of type error can't be parsed #269

jroper opened this issue May 1, 2019 · 3 comments

Comments

@jroper
Copy link
Contributor

jroper commented May 1, 2019

Skuber assumes that watch events will always contain the object that is being watched, but if the event type is error, this isn't true, here's an example payload for error events:

{
  "type": "ERROR",
  "object": {
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {},
    "status": "Failure",
    "message": "too old resource version: 2743975 (2744775)",
    "reason": "Gone",
    "code": 410
  }
}

Now that error I need to fix of course, but skuber shouldn't fail with a parse error when getting it. The watch API perhaps needs to be updated to handle error events differently.

@doriordan
Copy link
Owner

I agree that Skuber should support handling Error events properly. Perhaps adding a new, optional errors sink parameter to the API watch calls could address this, the watch flow would basically partition its output so that errors go to the error sink (if present), while create/update/delete events with valid objects continue to be consumed from the WatchEvent source returned by the watch call.

@monktastic
Copy link

Ugh, just got bitten by this. Spent many hours trying to debug this unhelpful error:

skuber.api.client.package$K8SException: Status(v1,Status,ListMeta(,,None),None,Some(Error parsing watched object),None,Some(List((/object/spec,List(JsonValidationError(List(error.path.missing),ArraySeq()))), (/object/status,List(JsonValidationError(List(error.expected.jsobject),ArraySeq()))))),None)

@chessman
Copy link
Contributor

I fixed it in the fork hagay3/skuber@45dfdc7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants