remove useless alwaysAdmit in apiserver test

pull/8/head
xuzhonghu 2018-04-25 16:37:08 +08:00
parent 61892abc94
commit e1bcca681d
1 changed files with 0 additions and 18 deletions

View File

@ -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)