Skip to content
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] add more support for multiple groups; move experimental/v1 to experimental/v1alpha1 #12755

Closed
wants to merge 6 commits into from

Conversation

caesarxuchao
Copy link
Member

ref #12413

changelog:

  1. commit e2c5575:
    enforces the URL exposed by apiserver to be in the form of APIPrefix/group/version/...

    • for api/v1, we set the APIPrefix="api", group="", version="v1", so the URL is still /api/v1
    • for experimental api, we set the APIPrefix="kube-api" (the exact name is open to discussion), group="experimental", version="v1alpha1", so the URL is /kube-api/experimental/v1alpha1. And all future API groups will have the same APIPrefix.
    • for openshift and other third party API, we can either make APIPrefix="osapi", group="", or APIPrefix="", group="osapi", so the URL will not be changed.

    Most changes in this commit is just name changes.

  2. commit 148a67d
    stops apiserver from encoding api.Status to a specific version unless the version is v1.

  3. commit cf8cfdc
    move api.Status from api/types.go to api/unversioned.go, because the apiserver sends unversioned Status for non-v1 objects since commit 148a67d. We cannot make non-backward compatible change to api.Status, but we can always make additive change.
    We may move other common kinds shared by groups (e.g., deleteoptions, listoptions) to unversioned.go, but that will be another PR

  4. commit 11c2904
    A toy experimental kind for testing purposes, copied from uluyol's branch. Will remove this commit before merge.

@uluyol @nikhiljindal @bgrant0607 @krousey

This PR is marked as WIP because I haven't run e2e tests yet.

There is a Todo list in #12413 (comment) trakcing other things needed to support multiple groups.

@caesarxuchao caesarxuchao added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Aug 15, 2015
@k8s-bot
Copy link

k8s-bot commented Aug 15, 2015

GCE e2e build/test failed for commit 11c2904efcd1fd054f52b57a1278505caf3e4c66.

@k8s-bot
Copy link

k8s-bot commented Aug 15, 2015

GCE e2e build/test failed for commit 9c1fe3d95da135ab32846b14d7d7479a62d725bc.

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2015

GCE e2e build/test failed for commit d6a5bdfaf991c64660864bb4c154c56a5a6f2421.

@bgrant0607
Copy link
Member

cc @smarterclayton

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2015

GCE e2e build/test passed for commit d0df366aee47de621250d3f878ae4b833ef5b4c4.

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2015

GCE e2e build/test passed for commit 2906eb5.

@@ -120,8 +119,7 @@ func NewAPIServer() *APIServer {
SecurePort: 6443,
APIRate: 10.0,
APIBurst: 200,
APIPrefix: "/api",
ExpAPIPrefix: "/experimental",
APIPrefix: "/kube-api",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't change the meaning of the existing APIPrefix flag. We should create a new flag that would apply to new groups.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, creation of a new KubeAPIPrefix flag should be moved to a separate PR.

@smarterclayton
Copy link
Contributor

@derekwaynecarr if you can look over this


import "strings"

func GetVersion(groupVersion string) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg/util is not a good place for this. This is api-specific code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, I suggest somewhere under pkg/api.

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2015

GCE e2e build/test passed for commit 16b2e94.

versionPath := path.Join(pkgBase, group, version)
versionPath := path.Join(pkgBase, *groupVersion)
if group == "experimental" {
//TODO: we should rename the direcotry /expapi to /experimental, so directory path match groupVerson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why /expapi can't be moved to pkg/api/experimental?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It's in the TODO list (#12413 (comment) point 4).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in the TODO list I'm planning moving it to pkg/experiemental. pkg/api/experimental makes more sense.

@caesarxuchao
Copy link
Member Author

#12888 superseded this. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants