-
Notifications
You must be signed in to change notification settings - Fork 167
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
Allow different resources to use different apiVersion #208
Comments
Is that needed anymore? It was commented as a patch for kubernetes/kubernetes#6439, which according to comments on that issue has a commit that addresses it. Also, +1 for not having to tie the client to a specific API version and endpoint, but allowing a single instance of the client to create resources for different manifest types. |
Is this anywhere on the roadmap? It would be great to decouple the client from a specific API version |
cc @moolitayer |
Not currently on my road map. Designing the API (as well as backward compatibility) for this might prove somewhat complex. I remember last time we discussed that, we had an idea of supporting some set_version which seems easier but might not support what is described here I don't think I'll be investing time in this anytime soon since it is not needed for my usecases if @simon3z will be willing to accept a pr for this I will be willing to review. |
I'd like to see how the design/api would look like before anyone investing into it. |
For the use case of template instantiation, we just create different clients according to the api and version we need. It could have been a little more elegant to use the same client with different versions, but I wouldn't consider it as a high priority item for us in this context. |
It seems to me that on the all requests (including It would be nice to not have to have multiple clients. This pattern feels cumbersome:
|
I had to do a similar system where I create multiple clients for different api/extension versions and then try to find out the suitable client which supports a particular entity type. It would be really great if kubeclient would just transparently support all different api versions with a single client instance. |
@garo OK for creation and update of resources (above request doesn't apply to getting resources). Although be advised that if the different api versions are changing the URL paths, that case we may not be able to handle so easily. |
Hey all. I've opened a PR to make multiple apis with a single client instance work as well as detecting kind/apiVersion from a I'm looking for feedback on the approach at this point. If my general approach looks good, I'll continue with tests/cleanup. |
Thanks @danajp! I asked @moolitayer and @cben to review your WIP PR. |
Overview of directionsOpened separate issues for several proposed directions, for easier discussion. (cc @stiller-leser @kuahyeow)
What do you think? |
Currently the apiVersion is set on the Kubeclient::Client.new and it's enforced in https://github.com/abonas/kubeclient/blob/master/lib/kubeclient/common.rb#L320
We should instead allow that the resource contains apiVersion by itself and Kubeclient should honour that. This would allow easily to read a standard Kubernetes manifest .yaml file and apply that into the apiserver, so that the .yaml specifies the api version it requires.
The text was updated successfully, but these errors were encountered: