From e1bcca681d856d68ac54f2fd26a075d79c05d2a9 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Wed, 25 Apr 2018 16:37:08 +0800 Subject: [PATCH] remove useless alwaysAdmit in apiserver test --- .../apiserver/pkg/endpoints/apiserver_test.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go index c6937aeafed..869a8338b63 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go @@ -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)