mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-12 01:59:05 +00:00
move factory package to scheduler
This commit is contained in:
@@ -23,17 +23,17 @@ import (
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
"k8s.io/kubernetes/pkg/scheduler/factory"
|
||||
"k8s.io/kubernetes/pkg/scheduler"
|
||||
)
|
||||
|
||||
var (
|
||||
algorithmProviderNames = []string{
|
||||
factory.DefaultProvider,
|
||||
scheduler.DefaultProvider,
|
||||
}
|
||||
)
|
||||
|
||||
func TestDefaultConfigExists(t *testing.T) {
|
||||
p, err := factory.GetAlgorithmProvider(factory.DefaultProvider)
|
||||
p, err := scheduler.GetAlgorithmProvider(scheduler.DefaultProvider)
|
||||
if err != nil {
|
||||
t.Errorf("error retrieving default provider: %v", err)
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func TestDefaultConfigExists(t *testing.T) {
|
||||
func TestAlgorithmProviders(t *testing.T) {
|
||||
for _, pn := range algorithmProviderNames {
|
||||
t.Run(pn, func(t *testing.T) {
|
||||
p, err := factory.GetAlgorithmProvider(pn)
|
||||
p, err := scheduler.GetAlgorithmProvider(pn)
|
||||
if err != nil {
|
||||
t.Fatalf("error retrieving provider: %v", err)
|
||||
}
|
||||
@@ -57,14 +57,14 @@ func TestAlgorithmProviders(t *testing.T) {
|
||||
}
|
||||
for _, pf := range p.PriorityFunctionKeys.List() {
|
||||
t.Run(fmt.Sprintf("priorityfunction/%s", pf), func(t *testing.T) {
|
||||
if !factory.IsPriorityFunctionRegistered(pf) {
|
||||
if !scheduler.IsPriorityFunctionRegistered(pf) {
|
||||
t.Errorf("priority function is not registered but is used in the algorithm provider")
|
||||
}
|
||||
})
|
||||
}
|
||||
for _, fp := range p.FitPredicateKeys.List() {
|
||||
t.Run(fmt.Sprintf("fitpredicate/%s", fp), func(t *testing.T) {
|
||||
if !factory.IsFitPredicateRegistered(fp) {
|
||||
if !scheduler.IsFitPredicateRegistered(fp) {
|
||||
t.Errorf("fit predicate is not registered but is used in the algorithm provider")
|
||||
}
|
||||
})
|
||||
@@ -76,7 +76,7 @@ func TestAlgorithmProviders(t *testing.T) {
|
||||
func TestApplyFeatureGates(t *testing.T) {
|
||||
for _, pn := range algorithmProviderNames {
|
||||
t.Run(pn, func(t *testing.T) {
|
||||
p, err := factory.GetAlgorithmProvider(pn)
|
||||
p, err := scheduler.GetAlgorithmProvider(pn)
|
||||
if err != nil {
|
||||
t.Fatalf("Error retrieving provider: %v", err)
|
||||
}
|
||||
@@ -98,7 +98,7 @@ func TestApplyFeatureGates(t *testing.T) {
|
||||
|
||||
for _, pn := range algorithmProviderNames {
|
||||
t.Run(pn, func(t *testing.T) {
|
||||
p, err := factory.GetAlgorithmProvider(pn)
|
||||
p, err := scheduler.GetAlgorithmProvider(pn)
|
||||
if err != nil {
|
||||
t.Fatalf("Error retrieving '%s' provider: %v", pn, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user