-
Notifications
You must be signed in to change notification settings - Fork 23
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
error handling when kube returns an error struct missing #6
Comments
@clux Thanks for your issues. Ah.. right. If it happens any error on
Here? kube-rs/kube@2b0397f |
Yeah, that change. I added kube-rs/kube@4e3589d as well, which will try to deserialize the error. It's not enough to just pass on reqwests error type like i do later on, because you will miss out on the important reason for why things failed. Like say on a 403, the reason often includes:
|
@clux Sorry for my responses delay, look good to me about your improvements!!
|
One thing I noticed is that data returned from the kube api is assumed to be parseable into the struct you give it:
kubernetes-rust/src/client/mod.rs
Line 37 in 9c5f29f
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!
The text was updated successfully, but these errors were encountered: