From 47463d777a8435d074d9308f473c9324f1f95096 Mon Sep 17 00:00:00 2001 From: kerthcet Date: Wed, 15 Dec 2021 11:59:56 +0800 Subject: [PATCH] change pluginsNeeded returned value to sets.String Signed-off-by: kerthcet --- pkg/scheduler/framework/runtime/framework.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go index 477f7e9f70c..9ef41a7983d 100644 --- a/pkg/scheduler/framework/runtime/framework.go +++ b/pkg/scheduler/framework/runtime/framework.go @@ -1259,25 +1259,26 @@ func (f *frameworkImpl) SharedInformerFactory() informers.SharedInformerFactory return f.informerFactory } -func (f *frameworkImpl) pluginsNeeded(plugins *config.Plugins) map[string]config.Plugin { - pgMap := make(map[string]config.Plugin) +func (f *frameworkImpl) pluginsNeeded(plugins *config.Plugins) sets.String { + pgSet := sets.String{} if plugins == nil { - return pgMap + return pgSet } find := func(pgs *config.PluginSet) { for _, pg := range pgs.Enabled { - pgMap[pg.Name] = pg + pgSet.Insert(pg.Name) } } + for _, e := range f.getExtensionPoints(plugins) { find(e.plugins) } - // Parse MultiPoint separately since they are not returned by f.getExtensionPoints() find(&plugins.MultiPoint) - return pgMap + + return pgSet } // ProfileName returns the profile name associated to this framework.