Merge pull request #35492 from madhusudancs/federation-kubefed-00

Automatic merge from submit-queue

Make the fake RESTClient usable by all the API groups, not just core.

cc @kubernetes/sig-cluster-federation @quinton-hoole @nikhiljindal
This commit is contained in:
Kubernetes Submit Queue 2016-10-26 21:47:34 -07:00 committed by GitHub
commit da3d03f640

View File

@ -47,6 +47,7 @@ func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) {
type RESTClient struct {
Client *http.Client
NegotiatedSerializer runtime.NegotiatedSerializer
GroupName string
Req *http.Request
Resp *http.Response
@ -94,8 +95,14 @@ func (c *RESTClient) request(verb string) *restclient.Request {
ns := c.NegotiatedSerializer
serializer, _ := ns.SerializerForMediaType(runtime.ContentTypeJSON, nil)
streamingSerializer, _ := ns.StreamingSerializerForMediaType(runtime.ContentTypeJSON, nil)
groupName := api.GroupName
if c.GroupName != "" {
groupName = c.GroupName
}
internalVersion := unversioned.GroupVersion{
Group: registered.GroupOrDie(api.GroupName).GroupVersion.Group,
Group: registered.GroupOrDie(groupName).GroupVersion.Group,
Version: runtime.APIVersionInternal,
}
internalVersion.Version = runtime.APIVersionInternal