mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Added plugins enabled at each extension point
This commit is contained in:
parent
32db5774a3
commit
7b60e7e2a3
@ -90,12 +90,6 @@ func LogOrWriteConfig(logger klog.Logger, fileName string, cfg *config.KubeSched
|
||||
return err
|
||||
}
|
||||
|
||||
defaultPluginString := "Plugins Enabled By Default:"
|
||||
for _, v := range configv1.GetDefaultPlugins.MultiPoint.Enabled {
|
||||
name := v.Name
|
||||
defaultPluginString += "\n" + "\t" + name
|
||||
}
|
||||
buf.WriteString(defaultPluginString)
|
||||
if loggerV.Enabled() {
|
||||
loggerV.Info("Using component config", "config", buf.String())
|
||||
}
|
||||
|
@ -26,8 +26,6 @@ import (
|
||||
"k8s.io/utils/ptr"
|
||||
)
|
||||
|
||||
var GetDefaultPlugins = getDefaultPlugins()
|
||||
|
||||
// getDefaultPlugins returns the default set of plugins.
|
||||
func getDefaultPlugins() *v1.Plugins {
|
||||
plugins := &v1.Plugins{
|
||||
|
@ -355,6 +355,34 @@ func NewFramework(ctx context.Context, r Registry, profile *config.KubeScheduler
|
||||
options.captureProfile(outputProfile)
|
||||
}
|
||||
|
||||
for _, e := range f.getExtensionPoints(profile.Plugins) {
|
||||
plugins := reflect.ValueOf(e.slicePtr).Elem()
|
||||
pluginType := plugins.Type().Elem()
|
||||
loggerV := logger.V(2)
|
||||
|
||||
enabledSet := newOrderedSet()
|
||||
for _, plugin := range e.plugins.Enabled {
|
||||
enabledSet.insert(plugin.Name)
|
||||
}
|
||||
|
||||
disabledSet := sets.New[string]()
|
||||
for _, disabledPlugin := range e.plugins.Disabled {
|
||||
disabledSet.Insert(disabledPlugin.Name)
|
||||
}
|
||||
|
||||
if disabledSet.Has("*") {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, ep := range profile.Plugins.MultiPoint.Enabled {
|
||||
if !enabledSet.has(ep.Name) {
|
||||
enabledSet.insert(ep.Name)
|
||||
}
|
||||
}
|
||||
|
||||
loggerV.Info("Plugins enabled for", "extension", pluginType, "plugins", enabledSet.list)
|
||||
}
|
||||
|
||||
f.setInstrumentedPlugins()
|
||||
return f, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user