{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16173","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16173/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16173/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16173/events","html_url":"https://github.com/kubernetes/kubernetes/issues/16173","id":113077539,"number":16173,"title":"APIGroups are hard to deal with in the code","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P1","name":"priority/P1","color":"eb6420"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/CSI","name":"team/CSI","color":"d2b48c"}],"state":"open","locked":false,"assignee":{"login":"caesarxuchao","id":2823529,"avatar_url":"https://avatars.githubusercontent.com/u/2823529?v=3","gravatar_id":"","url":"https://api.github.com/users/caesarxuchao","html_url":"https://github.com/caesarxuchao","followers_url":"https://api.github.com/users/caesarxuchao/followers","following_url":"https://api.github.com/users/caesarxuchao/following{/other_user}","gists_url":"https://api.github.com/users/caesarxuchao/gists{/gist_id}","starred_url":"https://api.github.com/users/caesarxuchao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caesarxuchao/subscriptions","organizations_url":"https://api.github.com/users/caesarxuchao/orgs","repos_url":"https://api.github.com/users/caesarxuchao/repos","events_url":"https://api.github.com/users/caesarxuchao/events{/privacy}","received_events_url":"https://api.github.com/users/caesarxuchao/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/16","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.2-candidate","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/16/labels","id":1278500,"number":16,"title":"v1.2-candidate","description":"Things to consider for next minor release.","creator":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"open_issues":211,"closed_issues":21,"state":"open","created_at":"2015-08-29T03:54:34Z","updated_at":"2015-11-13T23:42:51Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-10-23T18:43:44Z","updated_at":"2015-11-16T18:13:45Z","closed_at":null,"body":"APIGroups are a really useful features, but there are several areas of the code that need improvement to make their usage easier to understand.  These are few things I found while trying to reliably activate and configure the `extensions` group downstream\r\n\r\n1. We need a `GroupVersion` object to make it very obvious in the code when a bit of code relies on that.  Right now, sometimes its two strings, sometimes its one string to split, sometimes objects hold both.\r\n1. Validation is needed when starting a master to make sure that combination of `StorageDestinations`, `apiGroupVersionOverrides`, `storageVersions`, and the available `Groups` makes sense.  I suspect that there's a cleaner factorization.\r\n1. Functions like `InterfacesFor` need to decide if they take `GroupVersion` or just an API version.  I'm ok with either one, but right now you get things like an error message saying ` unsupported storage version: v1beta1 (valid: v1beta1)` because part of the code thinks its a version and part of it thinks its a `GroupVersion`.\r\n1. REST APIVersions are unrelated to storage APIVersions.  Right now, the REST preferred version is tied to the storage version.\r\n1. Reporting throughout the stack should understand that `Kind` strings are no longer unambiguous.  Types like `StatusDetails` should accept an `APIGroup` as well.\r\n1. Registrations of `GroupMeta` shouldn't be mutable.  I don't see why we'd ever want it mutable and its kind of crazy to change it part way through.\r\n1. Type registration and lookups seems to be split across three packages (`install`, `registered`, `latest`), all of which try to take APIGroups into account.  This needs reorganization.  Perhaps we could try a layered approach where `latest` is scoped to versions of a single APIGroup, `install` is responsible for handling registration with a `registered` package which is the source of truth for all metadata.  No other package should expose cross group metadata.\r\n1. Having combined clients makes it harder to trace the effects of disabling an APIGroup and risks potential name collisions going forward.  Splitting Clients on APIGroups seems reasonable.\r\n\r\n\r\nOne of the things that may help with factorization is trying to describe the existing `v1` API as an GroupVersion(\"\", \"v1\") throughout all of the code.  If its hard to read like that, then there's probably a factorization problem.\r\n\r\n@caesarxuchao @smarterclayton @liggitt @kubernetes/kube-api "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/157123762","html_url":"https://github.com/kubernetes/kubernetes/issues/16173#issuecomment-157123762","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16173","id":157123762,"user":{"login":"caesarxuchao","id":2823529,"avatar_url":"https://avatars.githubusercontent.com/u/2823529?v=3","gravatar_id":"","url":"https://api.github.com/users/caesarxuchao","html_url":"https://github.com/caesarxuchao","followers_url":"https://api.github.com/users/caesarxuchao/followers","following_url":"https://api.github.com/users/caesarxuchao/following{/other_user}","gists_url":"https://api.github.com/users/caesarxuchao/gists{/gist_id}","starred_url":"https://api.github.com/users/caesarxuchao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caesarxuchao/subscriptions","organizations_url":"https://api.github.com/users/caesarxuchao/orgs","repos_url":"https://api.github.com/users/caesarxuchao/repos","events_url":"https://api.github.com/users/caesarxuchao/events{/privacy}","received_events_url":"https://api.github.com/users/caesarxuchao/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T18:13:45Z","updated_at":"2015-11-16T18:13:45Z","body":"The laundry lists is in #17216."}}