Skip to content

Commit 43d9748

Browse files
author
Kenichi Omichi
committed
Add error handling for Register() call
Register() can return an error as [1], so this adds the error handling. [1]: https://github.com/kubernetes/kubernetes/blob/f772c9017c16bbc983e59a19162814629a467cef/pkg/scheduler/framework/v1alpha1/registry.go#L56
1 parent a1364be commit 43d9748

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/integration/scheduler/preemption_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,12 @@ func TestPreemption(t *testing.T) {
125125
// Initialize scheduler with a filter plugin.
126126
var filter tokenFilter
127127
registry := make(framework.Registry)
128-
registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
128+
err := registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
129129
return &filter, nil
130130
})
131+
if err != nil {
132+
t.Fatalf("Error registering a filter: %v", err)
133+
}
131134
plugins := &schedulerconfig.Plugins{
132135
Filter: &schedulerconfig.PluginSet{
133136
Enabled: []schedulerconfig.Plugin{

0 commit comments

Comments
 (0)