Stop creating three copies of admission plugins

This commit is contained in:
Jordan Liggitt 2022-11-04 13:35:15 -04:00
parent c8a3657bde
commit 318b089918
No known key found for this signature in database
2 changed files with 0 additions and 24 deletions

View File

@ -77,18 +77,6 @@ func createAggregatorConfig(
genericConfig.BuildHandlerChainFunc = genericapiserver.BuildHandlerChainWithStorageVersionPrecondition 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. // 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 // 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. // of changes to StorageConfig as that may lead to unexpected behavior when the options are applied.

View File

@ -50,18 +50,6 @@ func createAPIExtensionsConfig(
genericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{} genericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{}
genericConfig.RESTOptionsGetter = nil 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. // 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 // 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. // of changes to StorageConfig as that may lead to unexpected behavior when the options are applied.