mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Stop creating three copies of admission plugins
This commit is contained in:
		@@ -77,18 +77,6 @@ func createAggregatorConfig(
 | 
			
		||||
		genericConfig.BuildHandlerChainFunc = genericapiserver.BuildHandlerChainWithStorageVersionPrecondition
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// override genericConfig.AdmissionControl with kube-aggregator's scheme,
 | 
			
		||||
	// because aggregator apiserver should use its own scheme to convert its own resources.
 | 
			
		||||
	err := commandOptions.Admission.ApplyTo(
 | 
			
		||||
		&genericConfig,
 | 
			
		||||
		externalInformers,
 | 
			
		||||
		genericConfig.LoopbackClientConfig,
 | 
			
		||||
		utilfeature.DefaultFeatureGate,
 | 
			
		||||
		pluginInitializers...)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// copy the etcd options so we don't mutate originals.
 | 
			
		||||
	// we assume that the etcd options have been completed already.  avoid messing with anything outside
 | 
			
		||||
	// of changes to StorageConfig as that may lead to unexpected behavior when the options are applied.
 | 
			
		||||
 
 | 
			
		||||
@@ -50,18 +50,6 @@ func createAPIExtensionsConfig(
 | 
			
		||||
	genericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{}
 | 
			
		||||
	genericConfig.RESTOptionsGetter = nil
 | 
			
		||||
 | 
			
		||||
	// override genericConfig.AdmissionControl with apiextensions' scheme,
 | 
			
		||||
	// because apiextensions apiserver should use its own scheme to convert resources.
 | 
			
		||||
	err := commandOptions.Admission.ApplyTo(
 | 
			
		||||
		&genericConfig,
 | 
			
		||||
		externalInformers,
 | 
			
		||||
		genericConfig.LoopbackClientConfig,
 | 
			
		||||
		utilfeature.DefaultFeatureGate,
 | 
			
		||||
		pluginInitializers...)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// copy the etcd options so we don't mutate originals.
 | 
			
		||||
	// we assume that the etcd options have been completed already.  avoid messing with anything outside
 | 
			
		||||
	// of changes to StorageConfig as that may lead to unexpected behavior when the options are applied.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user