// buildAdmission constructs the admission chain
// TODO nilebox: Switch to RecommendedOptions and use method (a *AdmissionOptions) ApplyTo
buildAdmission constructs the admission chain
TODO nilebox: Switch to RecommendedOptions and use method (a *AdmissionOptions) ApplyTo
// buildAdmission constructs the admission chain // TODO nilebox : Switch to RecommendedOptions and use method ( a * AdmissionOptions ) ApplyTo
func buildAdmission(c *genericapiserver.RecommendedConfig, s *ServiceCatalogServerOptions,
	client internalclientset.Interface, sharedInformers informers.SharedInformerFactory,
	kubeClient kubeclientset.Interface, kubeSharedInformers kubeinformers.SharedInformerFactory) (admission.Interface, error) {
	pluginNames := enabledPluginNames(s.AdmissionOptions)
	glog.Infof("Admission control plugin names: %v", pluginNames)
	genericInitializer := initializer.New(kubeClient, kubeSharedInformers, c.Authorization.Authorizer, api.Scheme)
	scPluginInitializer := scadmission.NewPluginInitializer(client, sharedInformers, kubeClient, kubeSharedInformers)
	initializersChain := admission.PluginInitializers{
		scPluginInitializer,
		genericInitializer,
	}
	pluginsConfigProvider, err := admission.ReadAdmissionConfiguration(pluginNames, s.AdmissionOptions.ConfigFile, api.Scheme)
	if err != nil {
		return nil, fmt.Errorf("failed to read plugin config: %v", err)
	}
	return s.AdmissionOptions.Plugins.NewFromPlugins(pluginNames, pluginsConfigProvider, initializersChain, admission.DecoratorFunc(admissionmetrics.WithControllerMetrics))
}
func buildAdmission ( c * genericapiserver . RecommendedConfig , s * ServiceCatalogServerOptions , client internalclientset . Interface , sharedInformers informers . SharedInformerFactory , kubeClient kubeclientset . Interface , kubeSharedInformers kubeinformers . SharedInformerFactory ) ( admission . Interface , error ) { pluginNames := enabledPluginNames ( s . AdmissionOptions ) glog . Infof ( " " , pluginNames ) genericInitializer := initializer . New ( kubeClient , kubeSharedInformers , c . Authorization . Authorizer , api . Scheme ) scPluginInitializer := scadmission . NewPluginInitializer ( client , sharedInformers , kubeClient , kubeSharedInformers ) initializersChain := admission . PluginInitializers { scPluginInitializer , genericInitializer , } pluginsConfigProvider , err := admission . ReadAdmissionConfiguration ( pluginNames , s . AdmissionOptions . ConfigFile , api . Scheme ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return s . AdmissionOptions . Plugins . NewFromPlugins ( pluginNames , pluginsConfigProvider , initializersChain , admission . DecoratorFunc ( admissionmetrics . WithControllerMetrics ) ) }
buildAdmission constructs the admission chain
TODO nilebox: Switch to RecommendedOptions and use method (a *AdmissionOptions) ApplyTo
buildAdmission constructs the admission chain TODO nilebox : Switch to RecommendedOptions and use method ( a * AdmissionOptions ) ApplyTo