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
217d2f57
Commit
217d2f57
authored
Aug 15, 2016
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the error in registering /v1 api
parent
096dd4df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
install.go
federation/apis/core/install/install.go
+3
-1
core.go
federation/cmd/federation-apiserver/app/core.go
+8
-0
server_test.go
federation/cmd/federation-apiserver/app/server_test.go
+2
-2
No files found.
federation/apis/core/install/install.go
View file @
217d2f57
...
@@ -91,7 +91,9 @@ var userResources = []string{"svc"}
...
@@ -91,7 +91,9 @@ var userResources = []string{"svc"}
func
newRESTMapper
(
externalVersions
[]
unversioned
.
GroupVersion
)
meta
.
RESTMapper
{
func
newRESTMapper
(
externalVersions
[]
unversioned
.
GroupVersion
)
meta
.
RESTMapper
{
// the list of kinds that are scoped at the root of the api hierarchy
// the list of kinds that are scoped at the root of the api hierarchy
// if a kind is not enumerated here, it is assumed to have a namespace scope
// if a kind is not enumerated here, it is assumed to have a namespace scope
rootScoped
:=
sets
.
NewString
()
rootScoped
:=
sets
.
NewString
(
"Namespace"
,
)
// these kinds should be excluded from the list of resources
// these kinds should be excluded from the list of resources
ignoredKinds
:=
sets
.
NewString
(
ignoredKinds
:=
sets
.
NewString
(
...
...
federation/cmd/federation-apiserver/app/core.go
View file @
217d2f57
...
@@ -18,6 +18,14 @@ package app
...
@@ -18,6 +18,14 @@ package app
import
(
import
(
"github.com/golang/glog"
"github.com/golang/glog"
// HACK to ensure that rest mapper from pkg/api is registered for groupName="".
// This is required because both pkg/api/install and federation/apis/core/install
// are installing their respective groupMeta at the same groupName.
// federation/apis/core/install has only a subset of resources and hence if it gets registered first, then installation of v1 API fails in pkg/master.
// TODO(nikhiljindal): Fix this by ensuring that pkg/api/install and federation/apis/core/install do not conflict with each other.
_
"k8s.io/kubernetes/pkg/api/install"
"k8s.io/kubernetes/federation/apis/core"
"k8s.io/kubernetes/federation/apis/core"
_
"k8s.io/kubernetes/federation/apis/core/install"
_
"k8s.io/kubernetes/federation/apis/core/install"
"k8s.io/kubernetes/federation/apis/core/v1"
"k8s.io/kubernetes/federation/apis/core/v1"
...
...
federation/cmd/federation-apiserver/app/server_test.go
View file @
217d2f57
...
@@ -296,10 +296,10 @@ func testCoreResourceList(t *testing.T) {
...
@@ -296,10 +296,10 @@ func testCoreResourceList(t *testing.T) {
// Verify namespaces.
// Verify namespaces.
found
=
findResource
(
apiResourceList
.
APIResources
,
"namespaces"
)
found
=
findResource
(
apiResourceList
.
APIResources
,
"namespaces"
)
assert
.
NotNil
(
t
,
found
)
assert
.
NotNil
(
t
,
found
)
assert
.
Tru
e
(
t
,
found
.
Namespaced
)
assert
.
Fals
e
(
t
,
found
.
Namespaced
)
found
=
findResource
(
apiResourceList
.
APIResources
,
"namespaces/status"
)
found
=
findResource
(
apiResourceList
.
APIResources
,
"namespaces/status"
)
assert
.
NotNil
(
t
,
found
)
assert
.
NotNil
(
t
,
found
)
assert
.
Tru
e
(
t
,
found
.
Namespaced
)
assert
.
Fals
e
(
t
,
found
.
Namespaced
)
// Verify events.
// Verify events.
found
=
findResource
(
apiResourceList
.
APIResources
,
"events"
)
found
=
findResource
(
apiResourceList
.
APIResources
,
"events"
)
...
...
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