Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/podgrouper/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2"
v2 "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2"
kubeAiSchedulerV2alpha2 "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v2alpha2"
controllers "github.com/NVIDIA/KAI-scheduler/pkg/podgrouper"
pluginshub "github.com/NVIDIA/KAI-scheduler/pkg/podgrouper/podgrouper/hub"
Expand All @@ -51,7 +51,7 @@ func init() {

type App struct {
Mgr manager.Manager
DefaultPluginsHub pluginshub.PluginsHub
DefaultPluginsHub *pluginshub.DefaultPluginsHub

configs controllers.Configs
pluginsHub pluginshub.PluginsHub
Expand Down
13 changes: 13 additions & 0 deletions pkg/podgrouper/podgrouper/hub/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ func (ph *DefaultPluginsHub) GetPodGrouperPlugin(gvk metav1.GroupVersionKind) gr
return ph.defaultPlugin
}

func (ph *DefaultPluginsHub) GetDefaultPlugin() grouper.Grouper {
return ph.defaultPlugin
}

func (ph *DefaultPluginsHub) HasMatchingPlugin(gvk metav1.GroupVersionKind) bool {
// search using wildcard version - this hub will return a plugin even if the version is not exact match
gvk.Version = "*"
if _, found := ph.customPlugins[gvk]; found {
return true
}
return false
}

func NewDefaultPluginsHub(kubeClient client.Client, searchForLegacyPodGroups,
gangScheduleKnative bool, queueLabelKey, nodePoolLabelKey string,
defaultPrioritiesConfigMapName, defaultPrioritiesConfigMapNamespace string) *DefaultPluginsHub {
Expand Down
Loading