cleanup scheduler's in-tree plugins registry naming

This commit is contained in:
Abdullah Gharaibeh
2019-12-24 12:38:50 -05:00
parent 24469a3692
commit fe7de96ebe
7 changed files with 35 additions and 35 deletions

View File

@@ -2,7 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["default_registry.go"],
srcs = ["registry.go"],
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins",
visibility = ["//visibility:public"],
deps = [
@@ -72,7 +72,7 @@ filegroup(
go_test(
name = "go_default_test",
srcs = ["default_registry_test.go"],
srcs = ["registry_test.go"],
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",

View File

@@ -52,10 +52,10 @@ type RegistryArgs struct {
VolumeBinder *volumebinder.VolumeBinder
}
// NewDefaultRegistry builds the default registry with all the in-tree plugins.
// This is the registry that Kubernetes default scheduler uses. A scheduler that runs out of tree
// plugins can register additional plugins through the WithFrameworkOutOfTreeRegistry option.
func NewDefaultRegistry(args *RegistryArgs) framework.Registry {
// NewInTreeRegistry builds the registry with all the in-tree plugins.
// A scheduler that runs out of tree plugins can register additional plugins
// through the WithFrameworkOutOfTreeRegistry option.
func NewInTreeRegistry(args *RegistryArgs) framework.Registry {
return framework.Registry{
defaultpodtopologyspread.Name: defaultpodtopologyspread.New,
imagelocality.Name: imagelocality.New,
@@ -115,8 +115,8 @@ type ConfigProducerRegistry struct {
PriorityToConfigProducer map[string]ConfigProducer
}
// NewDefaultConfigProducerRegistry creates a new producer registry.
func NewDefaultConfigProducerRegistry() *ConfigProducerRegistry {
// NewConfigProducerRegistry creates a new producer registry.
func NewConfigProducerRegistry() *ConfigProducerRegistry {
registry := &ConfigProducerRegistry{
PredicateToConfigProducer: make(map[string]ConfigProducer),
PriorityToConfigProducer: make(map[string]ConfigProducer),

View File

@@ -41,7 +41,7 @@ func produceConfig(keys []string, producersMap map[string]ConfigProducer, args C
}
func TestRegisterConfigProducers(t *testing.T) {
registry := NewDefaultConfigProducerRegistry()
registry := NewConfigProducerRegistry()
testPredicateName1 := "testPredicate1"
testFilterName1 := "testFilter1"
registry.RegisterPredicate(testPredicateName1,