kube-scheduler: NewFramework function to pass the context parameter
Co-authored-by: Aldo Culquicondor <1299064+alculquicondor@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,8 @@ limitations under the License.
|
||||
package testing
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
kubeschedulerconfigv1 "k8s.io/kube-scheduler/config/v1"
|
||||
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
@@ -28,7 +30,7 @@ import (
|
||||
var configDecoder = scheme.Codecs.UniversalDecoder()
|
||||
|
||||
// NewFramework creates a Framework from the register functions and options.
|
||||
func NewFramework(fns []RegisterPluginFunc, profileName string, stopCh <-chan struct{}, opts ...runtime.Option) (framework.Framework, error) {
|
||||
func NewFramework(ctx context.Context, fns []RegisterPluginFunc, profileName string, opts ...runtime.Option) (framework.Framework, error) {
|
||||
registry := runtime.Registry{}
|
||||
profile := &schedulerapi.KubeSchedulerProfile{
|
||||
SchedulerName: profileName,
|
||||
@@ -37,7 +39,7 @@ func NewFramework(fns []RegisterPluginFunc, profileName string, stopCh <-chan st
|
||||
for _, f := range fns {
|
||||
f(®istry, profile)
|
||||
}
|
||||
return runtime.NewFramework(registry, profile, stopCh, opts...)
|
||||
return runtime.NewFramework(ctx, registry, profile, opts...)
|
||||
}
|
||||
|
||||
// RegisterPluginFunc is a function signature used in method RegisterFilterPlugin()
|
||||
|
Reference in New Issue
Block a user