mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
log enabled admission controller in order
This change log enabled mutating and validating admission controller in order.
This commit is contained in:
parent
c6ae1e51ad
commit
76aaba6d24
@ -127,6 +127,8 @@ func splitStream(config io.Reader) (io.Reader, io.Reader, error) {
|
||||
// the given plugins.
|
||||
func (ps *Plugins) NewFromPlugins(pluginNames []string, configProvider ConfigProvider, pluginInitializer PluginInitializer, decorator Decorator) (Interface, error) {
|
||||
handlers := []Interface{}
|
||||
mutationPlugins := []string{}
|
||||
validationPlugins := []string{}
|
||||
for _, pluginName := range pluginNames {
|
||||
pluginConfig, err := configProvider.ConfigFor(pluginName)
|
||||
if err != nil {
|
||||
@ -143,10 +145,20 @@ func (ps *Plugins) NewFromPlugins(pluginNames []string, configProvider ConfigPro
|
||||
} else {
|
||||
handlers = append(handlers, plugin)
|
||||
}
|
||||
|
||||
if _, ok := plugin.(MutationInterface); ok {
|
||||
mutationPlugins = append(mutationPlugins, pluginName)
|
||||
}
|
||||
if _, ok := plugin.(ValidationInterface); ok {
|
||||
validationPlugins = append(validationPlugins, pluginName)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(pluginNames) != 0 {
|
||||
glog.Infof("Loaded %d admission controller(s) successfully in the following order: %s.", len(pluginNames), strings.Join(pluginNames, ","))
|
||||
if len(mutationPlugins) != 0 {
|
||||
glog.Infof("Loaded %d mutating admission controller(s) successfully in the following order: %s.", len(mutationPlugins), strings.Join(mutationPlugins, ","))
|
||||
}
|
||||
if len(validationPlugins) != 0 {
|
||||
glog.Infof("Loaded %d validating admission controller(s) successfully in the following order: %s.", len(validationPlugins), strings.Join(validationPlugins, ","))
|
||||
}
|
||||
return chainAdmissionHandler(handlers), nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user