Skip to content

Commit

Permalink
Make the fake RESTClient usable by all the API groups, not just core.
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudancs committed Oct 25, 2016
1 parent 4c1eb90 commit ccb0e1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/client/unversioned/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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
Expand Down Expand Up @@ -80,8 +81,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
Expand Down

0 comments on commit ccb0e1a

Please sign in to comment.