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
a79cb3c4
Commit
a79cb3c4
authored
Apr 19, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stop changing the root path of the root webservice
parent
7ab0a9f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
apiserver.go
pkg/apiserver/apiserver.go
+8
-5
apiserver_test.go
pkg/apiserver/apiserver_test.go
+8
-6
master.go
pkg/master/master.go
+4
-3
No files found.
pkg/apiserver/apiserver.go
View file @
a79cb3c4
...
@@ -167,19 +167,22 @@ func (g *APIGroupVersion) newInstaller() *APIInstaller {
...
@@ -167,19 +167,22 @@ func (g *APIGroupVersion) newInstaller() *APIInstaller {
// TODO: document all handlers
// TODO: document all handlers
// InstallSupport registers the APIServer support functions
// InstallSupport registers the APIServer support functions
func
InstallSupport
(
mux
Mux
,
ws
*
restful
.
WebService
,
checks
...
healthz
.
HealthzChecker
)
{
func
InstallSupport
(
mux
Mux
,
checks
...
healthz
.
HealthzChecker
)
[]
*
restful
.
WebService
{
// TODO: convert healthz and metrics to restful and remove container arg
// TODO: convert healthz and metrics to restful and remove container arg
healthz
.
InstallHandler
(
mux
,
checks
...
)
healthz
.
InstallHandler
(
mux
,
checks
...
)
// Set up a service to return the git code version.
// Set up a service to return the git code version.
ws
.
Path
(
"/version"
)
versionWS
:=
new
(
restful
.
WebService
)
ws
.
Doc
(
"git code version from which this is built"
)
versionWS
.
Path
(
"/version"
)
ws
.
Route
(
versionWS
.
Doc
(
"git code version from which this is built"
)
ws
.
GET
(
"/"
)
.
To
(
handleVersion
)
.
versionWS
.
Route
(
versionWS
.
GET
(
"/"
)
.
To
(
handleVersion
)
.
Doc
(
"get the code version"
)
.
Doc
(
"get the code version"
)
.
Operation
(
"getCodeVersion"
)
.
Operation
(
"getCodeVersion"
)
.
Produces
(
restful
.
MIME_JSON
)
.
Produces
(
restful
.
MIME_JSON
)
.
Consumes
(
restful
.
MIME_JSON
))
Consumes
(
restful
.
MIME_JSON
))
return
[]
*
restful
.
WebService
{
versionWS
}
}
}
// InstallLogsSupport registers the APIServer log support function into a mux.
// InstallLogsSupport registers the APIServer log support function into a mux.
...
...
pkg/apiserver/apiserver_test.go
View file @
a79cb3c4
...
@@ -319,9 +319,10 @@ func handleInternal(storage map[string]rest.Storage, admissionControl admission.
...
@@ -319,9 +319,10 @@ func handleInternal(storage map[string]rest.Storage, admissionControl admission.
}
}
}
}
ws
:=
new
(
restful
.
WebService
)
webservices
:=
InstallSupport
(
mux
)
InstallSupport
(
mux
,
ws
)
for
i
:=
range
webservices
{
container
.
Add
(
ws
)
container
.
Add
(
webservices
[
i
])
}
return
&
defaultAPIServer
{
mux
,
container
}
return
&
defaultAPIServer
{
mux
,
container
}
}
}
...
@@ -3257,9 +3258,10 @@ func TestXGSubresource(t *testing.T) {
...
@@ -3257,9 +3258,10 @@ func TestXGSubresource(t *testing.T) {
panic
(
fmt
.
Sprintf
(
"unable to install container %s: %v"
,
group
.
GroupVersion
,
err
))
panic
(
fmt
.
Sprintf
(
"unable to install container %s: %v"
,
group
.
GroupVersion
,
err
))
}
}
ws
:=
new
(
restful
.
WebService
)
webservices
:=
InstallSupport
(
mux
)
InstallSupport
(
mux
,
ws
)
for
i
:=
range
webservices
{
container
.
Add
(
ws
)
container
.
Add
(
webservices
[
i
])
}
handler
:=
defaultAPIServer
{
mux
,
container
}
handler
:=
defaultAPIServer
{
mux
,
container
}
server
:=
httptest
.
NewServer
(
handler
)
server
:=
httptest
.
NewServer
(
handler
)
...
...
pkg/master/master.go
View file @
a79cb3c4
...
@@ -226,7 +226,7 @@ func (m *Master) InstallAPIs(c *Config) {
...
@@ -226,7 +226,7 @@ func (m *Master) InstallAPIs(c *Config) {
}
}
// TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver.
// TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver.
apiserver
.
InstallSupport
(
m
.
MuxHelper
,
m
.
RootWebService
,
healthzChecks
...
)
webservices
:=
apiserver
.
InstallSupport
(
m
.
MuxHelper
,
healthzChecks
...
)
if
c
.
EnableProfiling
{
if
c
.
EnableProfiling
{
m
.
MuxHelper
.
HandleFunc
(
"/metrics"
,
MetricsWithReset
)
m
.
MuxHelper
.
HandleFunc
(
"/metrics"
,
MetricsWithReset
)
...
@@ -234,8 +234,9 @@ func (m *Master) InstallAPIs(c *Config) {
...
@@ -234,8 +234,9 @@ func (m *Master) InstallAPIs(c *Config) {
m
.
MuxHelper
.
HandleFunc
(
"/metrics"
,
defaultMetricsHandler
)
m
.
MuxHelper
.
HandleFunc
(
"/metrics"
,
defaultMetricsHandler
)
}
}
// Install root web services
for
i
:=
range
webservices
{
m
.
HandlerContainer
.
Add
(
m
.
RootWebService
)
m
.
HandlerContainer
.
Add
(
webservices
[
i
])
}
// allGroups records all supported groups at /apis
// allGroups records all supported groups at /apis
allGroups
:=
[]
unversioned
.
APIGroup
{}
allGroups
:=
[]
unversioned
.
APIGroup
{}
...
...
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