mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Add error handling for Register() call
Register() can return an error as [1], so this adds the error handling.
[1]: f772c9017c/pkg/scheduler/framework/v1alpha1/registry.go (L56)
This commit is contained in:
parent
a1364be012
commit
43d9748d3a
@ -125,9 +125,12 @@ func TestPreemption(t *testing.T) {
|
||||
// Initialize scheduler with a filter plugin.
|
||||
var filter tokenFilter
|
||||
registry := make(framework.Registry)
|
||||
registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
|
||||
err := registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
|
||||
return &filter, nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Error registering a filter: %v", err)
|
||||
}
|
||||
plugins := &schedulerconfig.Plugins{
|
||||
Filter: &schedulerconfig.PluginSet{
|
||||
Enabled: []schedulerconfig.Plugin{
|
||||
|
Loading…
Reference in New Issue
Block a user