fix some golint in staging/src/k8s.io/apiserver/pkg/admission/plugin/

Kubernetes-commit: 3de8767dc6ca8d47d29f99c2956a5fcf54df84d9
This commit is contained in:
tanshanshan 2018-09-26 14:30:50 +08:00 committed by Kubernetes Publisher
parent ddd83db11a
commit 8d99f185d1
4 changed files with 5 additions and 3 deletions

View File

@ -56,6 +56,7 @@ type initializerOptions struct {
Initializers []string
}
// InitializationConfig specifies initialization config
type InitializationConfig interface {
Run(stopCh <-chan struct{})
Initializers() (*v1alpha1.InitializerConfiguration, error)

View File

@ -38,7 +38,7 @@ import (
)
const (
// Name of admission plug-in
// PluginName indicates the name of admission plug-in
PluginName = "NamespaceLifecycle"
// how long a namespace stays in the force live lookup cache before expiration.
forceLiveLookupTTL = 30 * time.Second
@ -72,6 +72,7 @@ type Lifecycle struct {
var _ = initializer.WantsExternalKubeInformerFactory(&Lifecycle{})
var _ = initializer.WantsExternalKubeClientSet(&Lifecycle{})
// Admit makes an admission decision based on the request attributes
func (l *Lifecycle) Admit(a admission.Attributes) error {
// prevent deletion of immortal namespaces
if a.GetOperation() == admission.Delete && a.GetKind().GroupKind() == v1.SchemeGroupVersion.WithKind("Namespace").GroupKind() && l.immortalNamespaces.Has(a.GetName()) {

View File

@ -28,7 +28,7 @@ import (
)
const (
// Name of admission plug-in
// PluginName indicates the name of admission plug-in
PluginName = "MutatingAdmissionWebhook"
)

View File

@ -25,7 +25,7 @@ import (
)
const (
// Name of admission plug-in
// PluginName indicates the name of admission plug-in
PluginName = "ValidatingAdmissionWebhook"
)