Merge pull request #24006 from caesarxuchao/thirdparty-preferredversion

Automatic merge from submit-queue

Use the first version as thirdparty resource preferredVersion

First commit is a one-liner, which implements the server-half of #23985.

The other two commits rearrange the test code, and add back a commented out test of thirdparty resource.

@lavalamp @nikhiljindal
This commit is contained in:
k8s-merge-robot
2016-04-17 16:02:59 -07:00
2 changed files with 122 additions and 114 deletions

View File

@@ -643,8 +643,9 @@ func (m *Master) InstallThirdPartyResource(rsrc *extensions.ThirdPartyResource)
Version: rsrc.Versions[0].Name,
}
apiGroup := unversioned.APIGroup{
Name: group,
Versions: []unversioned.GroupVersionForDiscovery{groupVersion},
Name: group,
Versions: []unversioned.GroupVersionForDiscovery{groupVersion},
PreferredVersion: groupVersion,
}
apiserver.AddGroupWebService(api.Codecs, m.HandlerContainer, path, apiGroup)
m.addThirdPartyResourceStorage(path, thirdparty.Storage[strings.ToLower(kind)+"s"].(*thirdpartyresourcedataetcd.REST), apiGroup)