File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
pkg/podgrouper/podgrouper/hub Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import (
2424 metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
2525 "sigs.k8s.io/controller-runtime/pkg/webhook"
2626
27- "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2"
27+ v2 "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2"
2828 kubeAiSchedulerV2alpha2 "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2alpha2"
2929 controllers "github.com/NVIDIA/KAI-scheduler/pkg/podgrouper"
3030 pluginshub "github.com/NVIDIA/KAI-scheduler/pkg/podgrouper/podgrouper/hub"
@@ -51,7 +51,7 @@ func init() {
5151
5252type App struct {
5353 Mgr manager.Manager
54- DefaultPluginsHub pluginshub.PluginsHub
54+ DefaultPluginsHub * pluginshub.DefaultPluginsHub
5555
5656 configs controllers.Configs
5757 pluginsHub pluginshub.PluginsHub
Original file line number Diff line number Diff line change @@ -77,6 +77,19 @@ func (ph *DefaultPluginsHub) GetPodGrouperPlugin(gvk metav1.GroupVersionKind) gr
7777 return ph .defaultPlugin
7878}
7979
80+ func (ph * DefaultPluginsHub ) GetDefaultPlugin () grouper.Grouper {
81+ return ph .defaultPlugin
82+ }
83+
84+ func (ph * DefaultPluginsHub ) HasMatchingPlugin (gvk metav1.GroupVersionKind ) bool {
85+ // search using wildcard version - this hub will return a plugin even if the version is not exact match
86+ gvk .Version = "*"
87+ if _ , found := ph .customPlugins [gvk ]; found {
88+ return true
89+ }
90+ return false
91+ }
92+
8093func NewDefaultPluginsHub (kubeClient client.Client , searchForLegacyPodGroups ,
8194 gangScheduleKnative bool , queueLabelKey , nodePoolLabelKey string ,
8295 defaultPrioritiesConfigMapName , defaultPrioritiesConfigMapNamespace string ) * DefaultPluginsHub {
You can’t perform that action at this time.
0 commit comments