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
dda71bdc
Commit
dda71bdc
authored
Jul 14, 2015
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add namespace to nickname to prevent dup swagger nicknames
parent
a7364c08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
v1.json
api/swagger-spec/v1.json
+0
-0
v1beta3.json
api/swagger-spec/v1beta3.json
+0
-0
api_installer.go
pkg/apiserver/api_installer.go
+21
-17
No files found.
api/swagger-spec/v1.json
View file @
dda71bdc
This diff is collapsed.
Click to expand it.
api/swagger-spec/v1beta3.json
View file @
dda71bdc
This diff is collapsed.
Click to expand it.
pkg/apiserver/api_installer.go
View file @
dda71bdc
...
...
@@ -366,6 +366,10 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
for
_
,
action
:=
range
actions
{
reqScope
.
Namer
=
action
.
Namer
m
:=
monitorFilter
(
action
.
Verb
,
resource
)
namespaced
:=
""
if
strings
.
Contains
(
action
.
Path
,
scope
.
ArgumentName
())
{
namespaced
=
"Namespaced"
}
switch
action
.
Verb
{
case
"GET"
:
// Get a resource.
var
handler
restful
.
RouteFunction
...
...
@@ -382,7 +386,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"read"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"read"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
append
(
storageMeta
.
ProducesMIMETypes
(
action
.
Verb
),
"application/json"
)
...
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedObject
)
.
Writes
(
versionedObject
)
...
...
@@ -402,7 +406,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"list"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"list"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
"application/json"
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedList
)
.
Writes
(
versionedList
)
...
...
@@ -434,7 +438,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"replace"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"replace"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
append
(
storageMeta
.
ProducesMIMETypes
(
action
.
Verb
),
"application/json"
)
...
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedObject
)
.
Reads
(
versionedObject
)
.
...
...
@@ -451,7 +455,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Consumes
(
string
(
api
.
JSONPatchType
),
string
(
api
.
MergePatchType
),
string
(
api
.
StrategicMergePatchType
))
.
Operation
(
"patch"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"patch"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
append
(
storageMeta
.
ProducesMIMETypes
(
action
.
Verb
),
"application/json"
)
...
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedObject
)
.
Reads
(
api
.
Patch
{})
.
...
...
@@ -473,7 +477,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"create"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"create"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
append
(
storageMeta
.
ProducesMIMETypes
(
action
.
Verb
),
"application/json"
)
...
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedObject
)
.
Reads
(
versionedObject
)
.
...
...
@@ -489,7 +493,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"delete"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"delete"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
append
(
storageMeta
.
ProducesMIMETypes
(
action
.
Verb
),
"application/json"
)
...
)
.
Writes
(
versionedStatus
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
versionedStatus
)
...
...
@@ -508,7 +512,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"watch"
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"watch"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
"application/json"
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
watchjson
.
WatchEvent
{})
.
Writes
(
watchjson
.
WatchEvent
{})
...
...
@@ -527,7 +531,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Filter
(
m
)
.
Doc
(
doc
)
.
Param
(
ws
.
QueryParameter
(
"pretty"
,
"If 'true', then the output is pretty printed."
))
.
Operation
(
"watch"
+
kind
+
strings
.
Title
(
subresource
)
+
"List"
)
.
Operation
(
"watch"
+
namespaced
+
kind
+
strings
.
Title
(
subresource
)
+
"List"
)
.
Produces
(
"application/json"
)
.
Returns
(
http
.
StatusOK
,
"OK"
,
watchjson
.
WatchEvent
{})
.
Writes
(
watchjson
.
WatchEvent
{})
...
...
@@ -538,12 +542,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
ws
.
Route
(
route
)
case
"PROXY"
:
// Proxy requests to a resource.
// Accept all methods as per https://github.com/GoogleCloudPlatform/kubernetes/issues/3996
addProxyRoute
(
ws
,
"GET"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"PUT"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"POST"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"DELETE"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"HEAD"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"OPTIONS"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"GET"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"PUT"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"POST"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"DELETE"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"HEAD"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
addProxyRoute
(
ws
,
"OPTIONS"
,
a
.
prefix
,
action
.
Path
,
proxyHandler
,
namespaced
,
kind
,
resource
,
subresource
,
hasSubresource
,
action
.
Params
)
case
"CONNECT"
:
for
_
,
method
:=
range
connecter
.
ConnectMethods
()
{
doc
:=
"connect "
+
method
+
" requests to "
+
kind
...
...
@@ -554,7 +558,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
To
(
ConnectResource
(
connecter
,
reqScope
,
admit
,
connectOptionsKind
,
path
,
connectSubpath
,
connectSubpathKey
))
.
Filter
(
m
)
.
Doc
(
doc
)
.
Operation
(
"connect"
+
strings
.
Title
(
strings
.
ToLower
(
method
))
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"connect"
+
strings
.
Title
(
strings
.
ToLower
(
method
))
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
"*/*"
)
.
Consumes
(
"*/*"
)
.
Writes
(
"string"
)
...
...
@@ -733,7 +737,7 @@ func routeFunction(handler http.Handler) restful.RouteFunction {
}
}
func
addProxyRoute
(
ws
*
restful
.
WebService
,
method
string
,
prefix
string
,
path
string
,
proxyHandler
http
.
Handler
,
kind
,
resource
,
subresource
string
,
hasSubresource
bool
,
params
[]
*
restful
.
Parameter
)
{
func
addProxyRoute
(
ws
*
restful
.
WebService
,
method
string
,
prefix
string
,
path
string
,
proxyHandler
http
.
Handler
,
namespaced
,
kind
,
resource
,
subresource
string
,
hasSubresource
bool
,
params
[]
*
restful
.
Parameter
)
{
doc
:=
"proxy "
+
method
+
" requests to "
+
kind
if
hasSubresource
{
doc
=
"proxy "
+
method
+
" requests to "
+
subresource
+
" of "
+
kind
...
...
@@ -741,7 +745,7 @@ func addProxyRoute(ws *restful.WebService, method string, prefix string, path st
proxyRoute
:=
ws
.
Method
(
method
)
.
Path
(
path
)
.
To
(
routeFunction
(
proxyHandler
))
.
Filter
(
monitorFilter
(
"PROXY"
,
resource
))
.
Doc
(
doc
)
.
Operation
(
"proxy"
+
strings
.
Title
(
method
)
+
kind
+
strings
.
Title
(
subresource
))
.
Operation
(
"proxy"
+
strings
.
Title
(
method
)
+
namespaced
+
kind
+
strings
.
Title
(
subresource
))
.
Produces
(
"*/*"
)
.
Consumes
(
"*/*"
)
.
Writes
(
"string"
)
...
...
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