mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #106851 from BinacsLee/binacs/cleanup-scheduler-profile
cleanup: return frameworkruntime.NewFramework directly
This commit is contained in:
commit
b9977a7b17
@ -20,6 +20,7 @@ package profile
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/client-go/kubernetes/scheme"
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
@ -37,11 +38,7 @@ func newProfile(cfg config.KubeSchedulerProfile, r frameworkruntime.Registry, re
|
|||||||
opts ...frameworkruntime.Option) (framework.Framework, error) {
|
opts ...frameworkruntime.Option) (framework.Framework, error) {
|
||||||
recorder := recorderFact(cfg.SchedulerName)
|
recorder := recorderFact(cfg.SchedulerName)
|
||||||
opts = append(opts, frameworkruntime.WithEventRecorder(recorder))
|
opts = append(opts, frameworkruntime.WithEventRecorder(recorder))
|
||||||
fwk, err := frameworkruntime.NewFramework(r, &cfg, opts...)
|
return frameworkruntime.NewFramework(r, &cfg, opts...)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return fwk, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map holds frameworks indexed by scheduler name.
|
// Map holds frameworks indexed by scheduler name.
|
||||||
|
Loading…
Reference in New Issue
Block a user