-
Notifications
You must be signed in to change notification settings - Fork 35
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
handling Kubernetes Errors #51
Comments
Hello again @lswith - is there a specific use case that you've got where a decoded map isn't good enough? I guess the main problem with errors from k8s is that the swagger spec doesn't give us any details on them. It'd be possible for me to write a struct manually and decode into that, but I'd need to pay attention to the k8s code to make sure that we didn't get out of sync in the future... |
So with regards to the struct, it's actually a generic Status https://github.com/kubernetes/apimachinery/blob/master/pkg/api/errors/errors.go#L40 Here is the main use case: I do understand though that this library is swagger -> Elixir codegen so it might be hard to implement. It might be worth doing though simply because if its not in the library, it'll have to be implemented by your users. Your users will also be syncing with k8s as well, but now it's custom and everyone will have to do it. |
I'm going to try and find out why k8s hasn't implemented their errors into the OpenAPI. |
Looking into this a tiny bit more, it seems like the StatusError contains a metaStatus, which is actually in the kube specs, and the kazan struct is here so it might be possible for kazan to parse one of these out on error... |
If your curious, I’ve opened a ticket on the kubernetes api machinery to have these errors in the OpenAPI spec: |
The
StatusError
that is returned when a call from kubernetes doesn't succeed would be useful.Currently its just being decoded https://github.com/obmarg/kazan/blob/master/lib/kazan/client/imp.ex#L160
The text was updated successfully, but these errors were encountered: