mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Stop creating three copies of admission plugins
This commit is contained in:
parent
c8a3657bde
commit
318b089918
@ -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.
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user