mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
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:
commit
da3d03f640
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user