Skip to content

Commit

Permalink
Merge pull request #987 from iawia002/clean-unused-lister
Browse files Browse the repository at this point in the history
Remove unused policyLister in the genericScheduler
  • Loading branch information
karmada-bot authored Nov 22, 2021
2 parents 42882cd + 953537d commit 3a8c15c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions pkg/scheduler/core/generic_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
clusterv1alpha1 "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
lister "github.com/karmada-io/karmada/pkg/generated/listers/policy/v1alpha1"
"github.com/karmada-io/karmada/pkg/scheduler/cache"
"github.com/karmada-io/karmada/pkg/scheduler/framework"
"github.com/karmada-io/karmada/pkg/scheduler/framework/runtime"
Expand All @@ -32,21 +31,17 @@ type ScheduleResult struct {
}

type genericScheduler struct {
schedulerCache cache.Cache
// TODO: move it into schedulerCache
policyLister lister.PropagationPolicyLister
schedulerCache cache.Cache
scheduleFramework framework.Framework
}

// NewGenericScheduler creates a genericScheduler object.
func NewGenericScheduler(
schedCache cache.Cache,
policyLister lister.PropagationPolicyLister,
plugins []string,
) ScheduleAlgorithm {
return &genericScheduler{
schedulerCache: schedCache,
policyLister: policyLister,
scheduleFramework: runtime.NewFramework(plugins),
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewScheduler(dynamicClient dynamic.Interface, karmadaClient karmadaclientse
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
schedulerCache := schedulercache.NewCache(clusterLister)
// TODO: make plugins as a flag
algorithm := core.NewGenericScheduler(schedulerCache, policyLister, []string{clusteraffinity.Name, tainttoleration.Name, apiinstalled.Name})
algorithm := core.NewGenericScheduler(schedulerCache, []string{clusteraffinity.Name, tainttoleration.Name, apiinstalled.Name})
sched := &Scheduler{
DynamicClient: dynamicClient,
KarmadaClient: karmadaClient,
Expand Down

0 comments on commit 3a8c15c

Please sign in to comment.