Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
63e31759
Commit
63e31759
authored
Oct 24, 2016
by
Madhusudan.C.S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the fake RESTClient usable by all the API groups, not just core.
parent
b1d8961f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
fake.go
pkg/client/unversioned/fake/fake.go
+8
-1
No files found.
pkg/client/unversioned/fake/fake.go
View file @
63e31759
...
@@ -47,6 +47,7 @@ func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) {
...
@@ -47,6 +47,7 @@ func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) {
type
RESTClient
struct
{
type
RESTClient
struct
{
Client
*
http
.
Client
Client
*
http
.
Client
NegotiatedSerializer
runtime
.
NegotiatedSerializer
NegotiatedSerializer
runtime
.
NegotiatedSerializer
GroupName
string
Req
*
http
.
Request
Req
*
http
.
Request
Resp
*
http
.
Response
Resp
*
http
.
Response
...
@@ -94,8 +95,14 @@ func (c *RESTClient) request(verb string) *restclient.Request {
...
@@ -94,8 +95,14 @@ func (c *RESTClient) request(verb string) *restclient.Request {
ns
:=
c
.
NegotiatedSerializer
ns
:=
c
.
NegotiatedSerializer
serializer
,
_
:=
ns
.
SerializerForMediaType
(
runtime
.
ContentTypeJSON
,
nil
)
serializer
,
_
:=
ns
.
SerializerForMediaType
(
runtime
.
ContentTypeJSON
,
nil
)
streamingSerializer
,
_
:=
ns
.
StreamingSerializerForMediaType
(
runtime
.
ContentTypeJSON
,
nil
)
streamingSerializer
,
_
:=
ns
.
StreamingSerializerForMediaType
(
runtime
.
ContentTypeJSON
,
nil
)
groupName
:=
api
.
GroupName
if
c
.
GroupName
!=
""
{
groupName
=
c
.
GroupName
}
internalVersion
:=
unversioned
.
GroupVersion
{
internalVersion
:=
unversioned
.
GroupVersion
{
Group
:
registered
.
GroupOrDie
(
api
.
G
roupName
)
.
GroupVersion
.
Group
,
Group
:
registered
.
GroupOrDie
(
g
roupName
)
.
GroupVersion
.
Group
,
Version
:
runtime
.
APIVersionInternal
,
Version
:
runtime
.
APIVersionInternal
,
}
}
internalVersion
.
Version
=
runtime
.
APIVersionInternal
internalVersion
.
Version
=
runtime
.
APIVersionInternal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment