Remove global variable dependency from runtimeclass admission
Kubernetes-commit: 57ea7a11a646e5ad9b3f5c42ba42c0b1d279286b
This commit is contained in:
parent
8701464958
commit
15ffd4d5c4
|
|
@ -51,6 +51,11 @@ func New(
|
||||||
// Initialize checks the initialization interfaces implemented by a plugin
|
// Initialize checks the initialization interfaces implemented by a plugin
|
||||||
// and provide the appropriate initialization data
|
// and provide the appropriate initialization data
|
||||||
func (i pluginInitializer) Initialize(plugin admission.Interface) {
|
func (i pluginInitializer) Initialize(plugin admission.Interface) {
|
||||||
|
// First tell the plugin about enabled features, so it can decide whether to start informers or not
|
||||||
|
if wants, ok := plugin.(WantsFeatures); ok {
|
||||||
|
wants.InspectFeatureGates(i.featureGates)
|
||||||
|
}
|
||||||
|
|
||||||
if wants, ok := plugin.(WantsExternalKubeClientSet); ok {
|
if wants, ok := plugin.(WantsExternalKubeClientSet); ok {
|
||||||
wants.SetExternalKubeClientSet(i.externalClient)
|
wants.SetExternalKubeClientSet(i.externalClient)
|
||||||
}
|
}
|
||||||
|
|
@ -62,10 +67,6 @@ func (i pluginInitializer) Initialize(plugin admission.Interface) {
|
||||||
if wants, ok := plugin.(WantsAuthorizer); ok {
|
if wants, ok := plugin.(WantsAuthorizer); ok {
|
||||||
wants.SetAuthorizer(i.authorizer)
|
wants.SetAuthorizer(i.authorizer)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wants, ok := plugin.(WantsFeatures); ok {
|
|
||||||
wants.InspectFeatureGates(i.featureGates)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ admission.PluginInitializer = pluginInitializer{}
|
var _ admission.PluginInitializer = pluginInitializer{}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue