mirror of https://github.com/k3s-io/k3s
remove useless alwaysAdmit in apiserver test
parent
61892abc94
commit
e1bcca681d
|
@ -71,18 +71,6 @@ import (
|
|||
"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{}
|
||||
|
||||
func (alwaysMutatingDeny) Admit(a admission.Attributes) (err error) {
|
||||
|
@ -233,7 +221,6 @@ func init() {
|
|||
|
||||
mapper = nsMapper
|
||||
namespaceMapper = nsMapper
|
||||
admissionControl = alwaysAdmit{}
|
||||
|
||||
scheme.AddFieldLabelConversionFunc(grouplessGroupVersion.String(), "Simple",
|
||||
func(label, value string) (string, string, error) {
|
||||
|
@ -263,11 +250,6 @@ func handle(storage map[string]rest.Storage) http.Handler {
|
|||
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
|
||||
func handleLinker(storage map[string]rest.Storage, selfLinker runtime.SelfLinker) http.Handler {
|
||||
return handleInternal(storage, admissionControl, selfLinker, nil)
|
||||
|
|
Loading…
Reference in New Issue