{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/39329955","id":39329955,"diff_hunk":"@@ -0,0 +1,114 @@\n+/*\n+Copyright 2014 The Kubernetes Authors All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package install\n+\n+import (\n+\t\"fmt\"\n+\t\"strings\"\n+\n+\t\"github.com/golang/glog\"\n+\n+\t\"k8s.io/kubernetes/pkg/api/latest\"\n+\t\"k8s.io/kubernetes/pkg/util/sets\"\n+\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/api/meta\"\n+\t\"k8s.io/kubernetes/pkg/api/registered\"\n+\tapiutil \"k8s.io/kubernetes/pkg/api/util\"\n+\t\"k8s.io/kubernetes/pkg/api/v1\"\n+\t\"k8s.io/kubernetes/pkg/runtime\"\n+)\n+\n+// userResources is a group of resources mostly used by a kubectl user\n+var userResources = []string{\"rc\", \"svc\", \"pods\", \"pvc\"}\n+\n+const importPrefix = \"k8s.io/kubernetes/pkg/api\"\n+\n+var accessor = meta.NewAccessor()\n+\n+func init() {\n+\tgroupMeta, err := latest.RegisterGroup(\"\")\n+\tif err != nil {\n+\t\tglog.V(4).Infof(\"%v\", err)\n+\t\treturn\n+\t}\n+\t// Use the first API version in the list of registered versions as the latest.\n+\tregisteredGroupVersions := registered.GroupVersionsForGroup(\"\")\n+\tgroupVersion := registeredGroupVersions[0]\n+\t*groupMeta = latest.GroupMeta{\n+\t\tGroupVersion: groupVersion,\n+\t\tGroup:        apiutil.GetGroup(groupVersion),\n+\t\tVersion:      apiutil.GetVersion(groupVersion),\n+\t\tCodec:        runtime.CodecFor(api.Scheme, groupVersion),\n+\t}\n+\tvar versions []string\n+\tfor i := len(registeredGroupVersions) - 1; i >= 0; i-- {\n+\t\tversions = append(versions, apiutil.GetVersion(registeredGroupVersions[i]))\n+\t}\n+\tgroupMeta.Versions = versions\n+\n+\tgroupMeta.SelfLinker = runtime.SelfLinker(accessor)\n+\n+\t// the list of kinds that are scoped at the root of the api hierarchy\n+\t// if a kind is not enumerated here, it is assumed to have a namespace scope\n+\t// the list of kinds that are scoped at the root of the api hierarchy\n+\t// if a kind is not enumerated here, it is assumed to have a namespace scope\n+\trootScoped := sets.NewString(\n+\t\t\"Node\",\n+\t\t\"Minion\",\n+\t\t\"Namespace\",\n+\t\t\"PersistentVolume\",\n+\t)\n+\n+\t// these kinds should be excluded from the list of resources\n+\tignoredKinds := sets.NewString(\n+\t\t\"ListOptions\",\n+\t\t\"DeleteOptions\",\n+\t\t\"Status\",\n+\t\t\"PodLogOptions\",\n+\t\t\"PodExecOptions\",\n+\t\t\"PodAttachOptions\",\n+\t\t\"PodProxyOptions\",\n+\t\t\"ThirdPartyResource\",\n+\t\t\"ThirdPartyResourceData\",\n+\t\t\"ThirdPartyResourceList\")\n+\n+\tmapper := api.NewDefaultRESTMapper(\"api\", versions, interfacesFor, importPrefix, ignoredKinds, rootScoped)\n+\t// setup aliases for groups of resources\n+\tmapper.AddResourceAlias(\"all\", userResources...)\n+\tgroupMeta.RESTMapper = mapper\n+\tapi.RegisterRESTMapper(groupMeta.RESTMapper)\n+\tgroupMeta.InterfacesFor = interfacesFor\n+}\n+\n+// InterfacesFor returns the default Codec and ResourceVersioner for a given version\n+// string, or an error if the version is not known.\n+func interfacesFor(version string) (*meta.VersionInterfaces, error) {\n+\tswitch version {\n+\tcase \"v1\":","path":"pkg/api/install/install.go","position":102,"original_position":102,"commit_id":"f0947e70fe39a413195fa67b5bdefe349718f213","original_commit_id":"ee9f984de4468064d9a307f1c1f6ebe8633f8f27","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},"body":"No, it installs all versions supported in a the group. It happens to be that we only have one version right now.","created_at":"2015-09-12T00:04:23Z","updated_at":"2015-09-12T00:04:23Z","html_url":"https://github.com/kubernetes/kubernetes/pull/13833#discussion_r39329955","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/39329955"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13833#discussion_r39329955"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833","id":44716019,"html_url":"https://github.com/kubernetes/kubernetes/pull/13833","diff_url":"https://github.com/kubernetes/kubernetes/pull/13833.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/13833.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13833","number":13833,"state":"open","locked":false,"title":"[WIP] Making a generic latest package","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},"body":"\r\nTODO: \r\n- [ ] clean up pkg/api/testapi/testapi.go\r\n- [ ] remove pkg/expapi/testapi/testapi.go\r\n- [ ] this [line](https://github.com/kubernetes/kubernetes/blob/master/pkg/client/unversioned/helper.go#L144)  creates experiemental client when we create v1 client. This causes problem now because we register experiemental API separately in KUBE_API_VERSIONS now, see [here](https://github.com/kubernetes/kubernetes/pull/13833/files#diff-1eafb8d8033d84a9c5504d4afcce81eaR41). As a temporary fix, I make KUBE_API_VERSIONS=v1,experimental/v1 in all scripts.","created_at":"2015-09-10T20:35:57Z","updated_at":"2015-09-12T00:04:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90aacdc6bd739d5b4248661152c5ee68c187b0e1","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13833/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/f0947e70fe39a413195fa67b5bdefe349718f213","head":{"label":"caesarxuchao:central-latest","ref":"central-latest","sha":"f0947e70fe39a413195fa67b5bdefe349718f213","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},"repo":{"id":34024678,"name":"kubernetes","full_name":"caesarxuchao/kubernetes","owner":{"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},"private":false,"html_url":"https://github.com/caesarxuchao/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/caesarxuchao/kubernetes","forks_url":"https://api.github.com/repos/caesarxuchao/kubernetes/forks","keys_url":"https://api.github.com/repos/caesarxuchao/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caesarxuchao/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caesarxuchao/kubernetes/teams","hooks_url":"https://api.github.com/repos/caesarxuchao/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/caesarxuchao/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/caesarxuchao/kubernetes/events","assignees_url":"https://api.github.com/repos/caesarxuchao/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/caesarxuchao/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/caesarxuchao/kubernetes/tags","blobs_url":"https://api.github.com/repos/caesarxuchao/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caesarxuchao/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caesarxuchao/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/caesarxuchao/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caesarxuchao/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/caesarxuchao/kubernetes/languages","stargazers_url":"https://api.github.com/repos/caesarxuchao/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/caesarxuchao/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/caesarxuchao/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/caesarxuchao/kubernetes/subscription","commits_url":"https://api.github.com/repos/caesarxuchao/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/caesarxuchao/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/caesarxuchao/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/caesarxuchao/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/caesarxuchao/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/caesarxuchao/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caesarxuchao/kubernetes/merges","archive_url":"https://api.github.com/repos/caesarxuchao/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caesarxuchao/kubernetes/downloads","issues_url":"https://api.github.com/repos/caesarxuchao/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/caesarxuchao/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/caesarxuchao/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/caesarxuchao/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caesarxuchao/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/caesarxuchao/kubernetes/releases{/id}","created_at":"2015-04-15T23:57:43Z","updated_at":"2015-05-07T17:21:06Z","pushed_at":"2015-09-11T23:16:52Z","git_url":"git://github.com/caesarxuchao/kubernetes.git","ssh_url":"git@github.com:caesarxuchao/kubernetes.git","clone_url":"https://github.com/caesarxuchao/kubernetes.git","svn_url":"https://github.com/caesarxuchao/kubernetes","homepage":"http://kubernetes.io","size":108476,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"3754abf5c16c8adb64efe205cfb86a257dc9e47c","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-09-11T20:33:08Z","pushed_at":"2015-09-11T23:52:39Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":403769,"stargazers_count":10191,"watchers_count":10191,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2509,"mirror_url":null,"open_issues_count":1764,"forks":2509,"open_issues":1764,"watchers":10191,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13833"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13833"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13833/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13833/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/f0947e70fe39a413195fa67b5bdefe349718f213"}}}}