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
45950fdb
Commit
45950fdb
authored
Feb 05, 2018
by
Nikhita Raghunath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/v1 should be first in discovery order
Currently, core/v1 is in the end of the discovery order. Since core/v1 is special, it should be in the beginning.
parent
551f73d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
discovery_client.go
staging/src/k8s.io/client-go/discovery/discovery_client.go
+2
-2
discovery_client_test.go
...g/src/k8s.io/client-go/discovery/discovery_client_test.go
+13
-2
No files found.
staging/src/k8s.io/client-go/discovery/discovery_client.go
View file @
45950fdb
...
@@ -145,9 +145,9 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err
...
@@ -145,9 +145,9 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err
apiGroupList
=
&
metav1
.
APIGroupList
{}
apiGroupList
=
&
metav1
.
APIGroupList
{}
}
}
//
ap
pend the group retrieved from /api to the list if not empty
//
pre
pend the group retrieved from /api to the list if not empty
if
len
(
v
.
Versions
)
!=
0
{
if
len
(
v
.
Versions
)
!=
0
{
apiGroupList
.
Groups
=
append
(
apiGroupList
.
Groups
,
apiGroup
)
apiGroupList
.
Groups
=
append
(
[]
metav1
.
APIGroup
{
apiGroup
},
apiGroupList
.
Groups
...
)
}
}
return
apiGroupList
,
nil
return
apiGroupList
,
nil
}
}
...
...
staging/src/k8s.io/client-go/discovery/discovery_client_test.go
View file @
45950fdb
...
@@ -74,6 +74,17 @@ func TestGetServerGroupsWithV1Server(t *testing.T) {
...
@@ -74,6 +74,17 @@ func TestGetServerGroupsWithV1Server(t *testing.T) {
"v1"
,
"v1"
,
},
},
}
}
case
"/apis"
:
obj
=
&
metav1
.
APIGroupList
{
Groups
:
[]
metav1
.
APIGroup
{
{
Name
:
"extensions"
,
Versions
:
[]
metav1
.
GroupVersionForDiscovery
{
{
GroupVersion
:
"extensions/v1beta1"
},
},
},
},
}
default
:
default
:
w
.
WriteHeader
(
http
.
StatusNotFound
)
w
.
WriteHeader
(
http
.
StatusNotFound
)
return
return
...
@@ -95,8 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) {
...
@@ -95,8 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) {
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
}
groupVersions
:=
metav1
.
ExtractGroupVersions
(
apiGroupList
)
groupVersions
:=
metav1
.
ExtractGroupVersions
(
apiGroupList
)
if
!
reflect
.
DeepEqual
(
groupVersions
,
[]
string
{
"v1"
})
{
if
!
reflect
.
DeepEqual
(
groupVersions
,
[]
string
{
"v1"
,
"extensions/v1beta1"
})
{
t
.
Errorf
(
"expected: %q, got: %q"
,
[]
string
{
"v1"
},
groupVersions
)
t
.
Errorf
(
"expected: %q, got: %q"
,
[]
string
{
"v1"
,
"extensions/v1beta1"
},
groupVersions
)
}
}
}
}
...
...
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