Skip to content

error handling when kube returns an error struct missing #6

Open
@clux

Description

@clux

One thing I noticed is that data returned from the kube api is assumed to be parseable into the struct you give it:

req.send()?.json().map_err(Error::from)

however, we have no real information on what went wrong if kube returns an error struct. We simply get a json parsing failed (usually "unexpected EOF" via serde) because the string is attempted to be coerced into a different struct to the one that contains the error.

This happens if you query for information about your own custom resources and you've failed to add the necessary rbac rules for it, but i'm sure there are many other cases.

There's currently got a fork to help me deal with this issue in my account (and to get some debug back when it's failed for now). I might be looking to submit a pr back if I stumble across a good solution to it. In the mean time, just thought this ought to be raised.

At any rate, thanks for this crate! It's allowed me to write a kube app with rust with only minor tweaks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions