Move scheduler interface to pkg/scheduler/framework

This commit is contained in:
Ali
2020-10-10 01:41:44 +11:00
parent 1dff024e64
commit 09b2e8f638
142 changed files with 1450 additions and 1362 deletions

View File

@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/multipoint",
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],

View File

@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/framework"
)
// CommunicatingPlugin is an example of a plugin that implements two
@@ -92,6 +92,6 @@ func (mc CommunicatingPlugin) PreBind(ctx context.Context, state *framework.Cycl
}
// New initializes a new plugin and returns it.
func New(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &CommunicatingPlugin{}, nil
}

View File

@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/prebind",
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],

View File

@@ -20,7 +20,7 @@ import (
"context"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/framework"
)
// StatelessPreBindExample is an example of a simple plugin that has no state
@@ -49,6 +49,6 @@ func (sr StatelessPreBindExample) PreBind(ctx context.Context, state *framework.
}
// New initializes a new plugin and returns it.
func New(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &StatelessPreBindExample{}, nil
}

View File

@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/stateful",
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",

View File

@@ -24,7 +24,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/framework"
)
// MultipointExample is an example plugin that is executed at multiple extension points.
@@ -82,7 +82,7 @@ func (mp *MultipointExample) PreBind(ctx context.Context, state *framework.Cycle
}
// New initializes a new plugin and returns it.
func New(config *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
func New(config *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
if config == nil {
klog.Error("MultipointExample configuration cannot be empty")
return nil, fmt.Errorf("MultipointExample configuration cannot be empty")