-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
[WIP] Make expapi an API group #12413
Comments
I have refactored expapi to use groupVersion="expapi/v1alpha1". I didn't change the field name "apiVersion" in TypeMeta, so in a JSON config file, one would write "apiVersion": "expapi/v1alpha1". I didn't change anything for api/v1, so people would still write "apiVersion": "v1" for a api/v1 object. Moving forward, we need to test the groupVersion design on api/v1 objects (where I expect we will meet many problems), but the changes should not affect the end-users, i.e., an end-user should still write "apiVersion": "v1" in the config file. Here is what I propose:
Comments are more than welcome. |
Some open questions:
|
We use "experimental" not "expapi" for exposing the experimental api, so it should be "experimental/v1alpha1". I believe that we had decided on provider/group/version/kind scoping (where everything following provider can differ completely depending on the provider—there were no immediate plans for dealing with multiple providers). So api, osapi, experimental are all categorized as groups. There is still the question of should we use HOST/group/version (what we do today) or HOST/api/group/version. The latter would mean that we wouldn't have to worry about conflicts with group names and unrelated functionality (e.g. swagger). |
Thanks. If api, osapi, experimental are all categorized as groups, then we have to deal with conflicting kind names in different groups, and user would need to specify group name in JSON config file. |
Here is a summary of the meeting with @nikhiljindal and @bgrant0607.
update: GroupForResource seems solve problem 3. |
Update: after discussion with @nikhiljindal, we changed our idea about point 1: I have implemented this work. I'll submit the PR after #12405 is merged. |
Todo:
|
Except OpenShift is really going to be:
The translate function is going to be kind of ugly too - that's something we can manage on our server based on legacy support without necessarily it having to cross over into the server codebase, and in our client code it's really something you should discover from the server, not make up on your own (client code shouldn't need translate). I guess I keep circling back to what the group is good for. Is it a prefix to divide API versions? Yes. Is it a mechanism whereby two identically named kinds could be separated? Yes. Does all of it still require a single global indirection to find? Yes. The map of "group+version+kind" is either discovery (against a known endpoint with a well known traversal path) or embedded into client code, or embedded into a config file on a client. Since client code is the only thing we've embedded it in, and API endpoints can infer group based on context, are we truly blocked by preserving the nil -> behavior? I don't want to choose URLs based on weird backwards compatibility - I'd rather have well structured URLs that recognize that URL conventions are just that, and that discovery is the problem we want to solve. Any client that wants to be generic to kube to talk to OpenShift already has to walk through some discovery path. I would just expect the client to be able to build the map of kind -> version -> group via the information provided during discovery, rather than make this something that has to be enforced via code. |
You are right. I changed my design to keep the openshift API URL. Here is the new design:
Doesn't the GroupForResource implement the translation? For future API groups, because we require the user to specify the APIVersion field using
I don't follow. What do you mean by
Do you have in mind how we shall do the |
@smarterclayton My plan for this was to allow open shift (or any plugin) to claim part of the URL space (e.g., an entire group), so that e.g. /api/openshift/... would be redirected to https://someotherserver.somewhere/api/openshift/. This way the client doesn't have to do any additional discovery. (We can solve the backwards compatibility case in a number of ways, including by just letting you have the old /oapi/ redirected, too.) |
I'm not sure that's something that is generally useful or what I would want Redirection sits in the uncomfortable space between proxying and true On Mon, Sep 14, 2015 at 4:07 PM, Daniel Smith notifications@github.com
Clayton Coleman | Lead Engineer, OpenShift |
We have experimental group and its version is independent of the legacy v1 now. Closing this issue. |
#12001 introduce the experimental api prefix, but it's not introduced as an API group and it thus has to share the version with the official API (i.e., v1).
As suggested in #10009 (comment), we can make API group part of the API version to expedite its prototyping.
Here is a laundry list of works required to refactor expapi as an API group, the list is short for now, but I expect it to grow along the way:
@bgrant0607 @uluyol @nikhiljindal
The text was updated successfully, but these errors were encountered: