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
61ba8ca0
Commit
61ba8ca0
authored
Jul 20, 2017
by
mbohlool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Operation names for subresources
parent
d368afd8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
installer.go
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
+8
-0
openapi.go
...ing/src/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
+0
-4
No files found.
staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
View file @
61ba8ca0
...
@@ -577,6 +577,14 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
...
@@ -577,6 +577,14 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
routes
:=
[]
*
restful
.
RouteBuilder
{}
routes
:=
[]
*
restful
.
RouteBuilder
{}
// If there is a subresource, kind should be the parent's kind.
if
hasSubresource
{
fqParentKind
,
err
:=
a
.
getResourceKind
(
resource
,
a
.
group
.
Storage
[
resource
])
if
err
!=
nil
{
return
nil
,
err
}
kind
=
fqParentKind
.
Kind
}
switch
action
.
Verb
{
switch
action
.
Verb
{
case
"GET"
:
// Get a resource.
case
"GET"
:
// Get a resource.
var
handler
restful
.
RouteFunction
var
handler
restful
.
RouteFunction
...
...
staging/src/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
View file @
61ba8ca0
...
@@ -63,10 +63,6 @@ func GetOperationIDAndTags(r *restful.Route) (string, []string, error) {
...
@@ -63,10 +63,6 @@ func GetOperationIDAndTags(r *restful.Route) (string, []string, error) {
op
:=
r
.
Operation
op
:=
r
.
Operation
path
:=
r
.
Path
path
:=
r
.
Path
var
tags
[]
string
var
tags
[]
string
// TODO: This is hacky, figure out where this name conflict is created and fix it at the root.
if
strings
.
HasPrefix
(
path
,
"/apis/extensions/v1beta1/namespaces/{namespace}/"
)
&&
strings
.
HasSuffix
(
op
,
"ScaleScale"
)
{
op
=
op
[
:
len
(
op
)
-
10
]
+
strings
.
Title
(
strings
.
Split
(
path
[
48
:
],
"/"
)[
0
])
+
"Scale"
}
prefix
,
exists
:=
verbs
.
GetPrefix
(
op
)
prefix
,
exists
:=
verbs
.
GetPrefix
(
op
)
if
!
exists
{
if
!
exists
{
return
op
,
tags
,
fmt
.
Errorf
(
"operation names should start with a verb. Cannot determine operation verb from %v"
,
op
)
return
op
,
tags
,
fmt
.
Errorf
(
"operation names should start with a verb. Cannot determine operation verb from %v"
,
op
)
...
...
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