mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Utilized ListPlugins method
This commit is contained in:
parent
7b60e7e2a3
commit
1dca49157a
@ -355,32 +355,14 @@ func NewFramework(ctx context.Context, r Registry, profile *config.KubeScheduler
|
|||||||
options.captureProfile(outputProfile)
|
options.captureProfile(outputProfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, e := range f.getExtensionPoints(profile.Plugins) {
|
// Logs the enabled plugins enabled for each extension point
|
||||||
plugins := reflect.ValueOf(e.slicePtr).Elem()
|
m := f.ListPlugins()
|
||||||
pluginType := plugins.Type().Elem()
|
pluginMap := reflect.ValueOf(*m)
|
||||||
|
typeOfMap := pluginMap.Type()
|
||||||
|
|
||||||
|
for i := 0; i < pluginMap.NumField(); i++ {
|
||||||
loggerV := logger.V(2)
|
loggerV := logger.V(2)
|
||||||
|
loggerV.Info("Plugins enabled for", "extension", typeOfMap.Field(i).Name, "plugins", pluginMap.Field(i).Interface())
|
||||||
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()
|
f.setInstrumentedPlugins()
|
||||||
|
Loading…
Reference in New Issue
Block a user