-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Versioned clients #4874
Comments
See #3955 and #1451 (comment). Clients generating specific objects, such as kubectl run-container, should target a specific API version (or multiple specific versions). Generic clients shouldn't be versioned. They should only get the schema via swagger. |
On the timing of when to fix this. Goal is we want pkg/client users to work with versioned api types instead of unversioned types. So at some point we'll want to alias api to api/v1beta3 (in e.g. test code). When we have v1beta3 as default but before we've accumulated many changes, then the diff between internal types and v1beta3 types should be minimized. ...so now would be a good time to think about doing this, actually. |
cc @vishh |
@lavalamp: My understanding was that we are are doing this before v1.0. On Wed, Apr 1, 2015 at 10:24 AM, Brian Grant notifications@github.com
|
I want to argue for a prio boost on this. If we go 1.0 and we leave internal structs exposed, we're as good as frozen. We should either a) hide all the internal structs and have purely versioned client libs (how do we get DeltaFIFO and cache and controller framework etc for versioned?) Almost all of our own components would be better off with versioned interfaces, but I think all the work that has been done on client libs and controller framework has to apply. I propose P2, enhancement, v1.0 milestone. Needs an owner ASAP. |
Casting aside the fact the either is not a ternary operator, if nobody else want to take this on then I'd be happy to help esp. if we follow Daniel's proposal to have versioned Go client libraries but address the issues in (a). I think Brain said there were some technicalities to do with (b) w.r.t. encoding for a few fields but perhaps these could be overcome somehow. (c) would be a shame. |
One option is to get an intern to work on (b) but it might be too little On Fri, Apr 10, 2015 at 12:04 AM, Satnam Singh notifications@github.com
|
Swagger codegen for Go doesn't yet exist. And it doesn't yet work for any language for our API AFAIK. There are no intrinsic blockers to codegen that I'm aware of. Some of the fields that require custom marshaling/unmarshaling would need custom client code, but that doesn't seem like a big deal. I don't think most clients would need complicated types, such as Resource Quantity. Users could just provide the strings. If we have time, this would be great to do sooner rather than later. The problem will get bigger over time. I'm not sure there is a hard deadline, though. |
Indeed swagger codegen for Go seems to be an open issue: swagger-api/swagger-codegen#325 @bgrant0607 : let me be sure about what you mean. You mean "write a program that parses the swagger spec and spits out a Go client library?" Or do you mean something else? |
My concern is that, based on our own experiences and the evolution of the On Fri, Apr 10, 2015 at 9:23 AM, Satnam Singh notifications@github.com
|
/subscribe |
If this is something that needs attention soon thenI am happy to direct some energy in this direction, although that may not please Tim since I am supposed to be learning about networking. |
Package factoring to consider: #7584. |
OK. Time to do this. The motivation is so that people can import pkg/client/v1 and have code that will continue to build against head without changes as long as v1 is supported. Proposed factoring:
I propose doing this in a few steps.
|
What about:
|
The above WIP PR #13098 is a mess. To directly address those issues, I would I would also like to move the There are some things which are in this package that I'm not sure belong in
With those changes, the code left in the actual versioned clients should be |
My opinions on your concerns...
|
cc: @caesarxuchao |
I think pkg/client/cache is and should remain version agnostic. It's a general caching layer and should work with runtime.Objects.
Should be moved into the high level client, or a generic high-ish level client (like kubectl's builder)
I actually think we should leave the codec in the RESTClient. There should be an additional layer under RESTClient, the http connection/transport/cert layer; RESTClients that actually point at the same server can re-use that layer. This should help @smarterclayton with openshift integration. Other misc thoughts:
|
Explicit proposal in #15730 |
I think if #21408 merges, we can punt the rest of this to the next release. |
#21408 has merged, time to punt? |
Clientset is our versioned client. The next step is extract the client lib into its own repo, then vendor it in the main repo, and convert pkg/controllers and pkg/kubelet to use the versioned client. AFAIK, kubectl should use the dynamic client, @krousey is working on it and have more insight. |
@caesarxuchao Is there a tracking issue for "next step is extract the client lib into its own repo"? |
Closing in favor of #29934 as it represents the remaining tasks and is owned by the person actively working on it. |
Right now, pkg/client auto-converts everything to our internal, unversioned format. This is convenient for kubernetes components, but not so convenient for any 3rd party users. (The whole point of the versioning system is so that we can make changes to the unversioned structs without affecting downstream users.)
So we should maintain versioned clients.
It is possible that this is as easy as copying pkg/client and replacing the
"pkg/api"
imports withapi "pkg/api/v1beta1"
. If so, we should do this soon. If it turns out to be much more complex than that, we can defer this change until after 1.0, I think.When we deprecate an old client version, we should be nice and provide people a list of gofmt rewrite rules which will switch them to the next client version.
The text was updated successfully, but these errors were encountered: