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
e1bcca68
Commit
e1bcca68
authored
Apr 25, 2018
by
xuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove useless alwaysAdmit in apiserver test
parent
61892abc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
18 deletions
+0
-18
apiserver_test.go
staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go
+0
-18
No files found.
staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go
View file @
e1bcca68
...
@@ -71,18 +71,6 @@ import (
...
@@ -71,18 +71,6 @@ import (
"k8s.io/apiserver/pkg/server/filters"
"k8s.io/apiserver/pkg/server/filters"
)
)
// alwaysAdmit is an implementation of admission.Interface which always says yes to an admit request.
// It is useful in tests and when using kubernetes in an open manner.
type
alwaysAdmit
struct
{}
func
(
alwaysAdmit
)
Admit
(
a
admission
.
Attributes
)
(
err
error
)
{
return
nil
}
func
(
alwaysAdmit
)
Handles
(
operation
admission
.
Operation
)
bool
{
return
true
}
type
alwaysMutatingDeny
struct
{}
type
alwaysMutatingDeny
struct
{}
func
(
alwaysMutatingDeny
)
Admit
(
a
admission
.
Attributes
)
(
err
error
)
{
func
(
alwaysMutatingDeny
)
Admit
(
a
admission
.
Attributes
)
(
err
error
)
{
...
@@ -233,7 +221,6 @@ func init() {
...
@@ -233,7 +221,6 @@ func init() {
mapper
=
nsMapper
mapper
=
nsMapper
namespaceMapper
=
nsMapper
namespaceMapper
=
nsMapper
admissionControl
=
alwaysAdmit
{}
scheme
.
AddFieldLabelConversionFunc
(
grouplessGroupVersion
.
String
(),
"Simple"
,
scheme
.
AddFieldLabelConversionFunc
(
grouplessGroupVersion
.
String
(),
"Simple"
,
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
...
@@ -263,11 +250,6 @@ func handle(storage map[string]rest.Storage) http.Handler {
...
@@ -263,11 +250,6 @@ func handle(storage map[string]rest.Storage) http.Handler {
return
handleInternal
(
storage
,
admissionControl
,
selfLinker
,
nil
)
return
handleInternal
(
storage
,
admissionControl
,
selfLinker
,
nil
)
}
}
// tests using the new namespace scope mechanism
func
handleNamespaced
(
storage
map
[
string
]
rest
.
Storage
)
http
.
Handler
{
return
handleInternal
(
storage
,
admissionControl
,
selfLinker
,
nil
)
}
// tests using a custom self linker
// tests using a custom self linker
func
handleLinker
(
storage
map
[
string
]
rest
.
Storage
,
selfLinker
runtime
.
SelfLinker
)
http
.
Handler
{
func
handleLinker
(
storage
map
[
string
]
rest
.
Storage
,
selfLinker
runtime
.
SelfLinker
)
http
.
Handler
{
return
handleInternal
(
storage
,
admissionControl
,
selfLinker
,
nil
)
return
handleInternal
(
storage
,
admissionControl
,
selfLinker
,
nil
)
...
...
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