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
fd4a4ba9
Commit
fd4a4ba9
authored
Jul 24, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11252 from nikhiljindal/verDocs
Stop allowing unnamespaced POST for namespaced objects
parents
e1b92dde
2f946b7a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
v1.json
api/swagger-spec/v1.json
+0
-0
api_installer.go
pkg/apiserver/api_installer.go
+0
-1
apiserver_test.go
pkg/apiserver/apiserver_test.go
+3
-3
No files found.
api/swagger-spec/v1.json
View file @
fd4a4ba9
This diff is collapsed.
Click to expand it.
pkg/apiserver/api_installer.go
View file @
fd4a4ba9
...
@@ -327,7 +327,6 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
...
@@ -327,7 +327,6 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
if
!
hasSubresource
{
if
!
hasSubresource
{
namer
=
scopeNaming
{
scope
,
a
.
group
.
Linker
,
gpath
.
Join
(
a
.
prefix
,
itemPath
),
true
}
namer
=
scopeNaming
{
scope
,
a
.
group
.
Linker
,
gpath
.
Join
(
a
.
prefix
,
itemPath
),
true
}
actions
=
appendIf
(
actions
,
action
{
"LIST"
,
resource
,
params
,
namer
},
isLister
)
actions
=
appendIf
(
actions
,
action
{
"LIST"
,
resource
,
params
,
namer
},
isLister
)
actions
=
appendIf
(
actions
,
action
{
"POST"
,
resource
,
params
,
namer
},
isCreater
)
actions
=
appendIf
(
actions
,
action
{
"WATCHLIST"
,
"watch/"
+
resource
,
params
,
namer
},
allowWatchList
)
actions
=
appendIf
(
actions
,
action
{
"WATCHLIST"
,
"watch/"
+
resource
,
params
,
namer
},
allowWatchList
)
}
}
break
break
...
...
pkg/apiserver/apiserver_test.go
View file @
fd4a4ba9
...
@@ -2196,7 +2196,7 @@ func TestCreateInvokesAdmissionControl(t *testing.T) {
...
@@ -2196,7 +2196,7 @@ func TestCreateInvokesAdmissionControl(t *testing.T) {
t
:
t
,
t
:
t
,
name
:
"bar"
,
name
:
"bar"
,
namespace
:
"other"
,
namespace
:
"other"
,
expectedSet
:
"/api/version/
foo/bar?namespace=othe
r"
,
expectedSet
:
"/api/version/
namespaces/other/foo/ba
r"
,
}
}
handler
:=
handleInternal
(
true
,
map
[
string
]
rest
.
Storage
{
"foo"
:
&
storage
},
deny
.
NewAlwaysDeny
(),
selfLinker
)
handler
:=
handleInternal
(
true
,
map
[
string
]
rest
.
Storage
{
"foo"
:
&
storage
},
deny
.
NewAlwaysDeny
(),
selfLinker
)
server
:=
httptest
.
NewServer
(
handler
)
server
:=
httptest
.
NewServer
(
handler
)
...
@@ -2207,7 +2207,7 @@ func TestCreateInvokesAdmissionControl(t *testing.T) {
...
@@ -2207,7 +2207,7 @@ func TestCreateInvokesAdmissionControl(t *testing.T) {
Other
:
"bar"
,
Other
:
"bar"
,
}
}
data
,
_
:=
codec
.
Encode
(
simple
)
data
,
_
:=
codec
.
Encode
(
simple
)
request
,
err
:=
http
.
NewRequest
(
"POST"
,
server
.
URL
+
"/api/version/
foo?namespace=other
"
,
bytes
.
NewBuffer
(
data
))
request
,
err
:=
http
.
NewRequest
(
"POST"
,
server
.
URL
+
"/api/version/
namespaces/other/foo
"
,
bytes
.
NewBuffer
(
data
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
t
.
Errorf
(
"unexpected error: %v"
,
err
)
}
}
...
@@ -2330,7 +2330,7 @@ func TestCreateTimeout(t *testing.T) {
...
@@ -2330,7 +2330,7 @@ func TestCreateTimeout(t *testing.T) {
simple
:=
&
Simple
{
Other
:
"foo"
}
simple
:=
&
Simple
{
Other
:
"foo"
}
data
,
_
:=
codec
.
Encode
(
simple
)
data
,
_
:=
codec
.
Encode
(
simple
)
itemOut
:=
expectApiStatus
(
t
,
"POST"
,
server
.
URL
+
"/api/version/foo?timeout=4ms"
,
data
,
apierrs
.
StatusServerTimeout
)
itemOut
:=
expectApiStatus
(
t
,
"POST"
,
server
.
URL
+
"/api/version/
namespaces/default/
foo?timeout=4ms"
,
data
,
apierrs
.
StatusServerTimeout
)
if
itemOut
.
Status
!=
api
.
StatusFailure
||
itemOut
.
Reason
!=
api
.
StatusReasonTimeout
{
if
itemOut
.
Status
!=
api
.
StatusFailure
||
itemOut
.
Reason
!=
api
.
StatusReasonTimeout
{
t
.
Errorf
(
"Unexpected status %#v"
,
itemOut
)
t
.
Errorf
(
"Unexpected status %#v"
,
itemOut
)
}
}
...
...
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