diff --git a/pkg/controller/nodes/task/handler.go b/pkg/controller/nodes/task/handler.go index bb28ae32ef..47af24e26f 100644 --- a/pkg/controller/nodes/task/handler.go +++ b/pkg/controller/nodes/task/handler.go @@ -258,7 +258,7 @@ func (t *Handler) Setup(ctx context.Context, sCtx handler.SetupContext) error { // Read from the fallback task handler map for any remaining tasks without a defaultPlugins registered handler. for taskType, registeredPlugins := range fallbackTaskHandlerMap { if _, ok := t.defaultPlugins[taskType]; ok { - break + continue } if len(registeredPlugins) != 1 { logger.Errorf(ctx, "Multiple plugins registered to handle task type: %s. ([%+v])", taskType, registeredPlugins) diff --git a/pkg/controller/nodes/task/handler_test.go b/pkg/controller/nodes/task/handler_test.go index 00730ec919..0538c322ec 100644 --- a/pkg/controller/nodes/task/handler_test.go +++ b/pkg/controller/nodes/task/handler_test.go @@ -213,6 +213,20 @@ func Test_task_Setup(t *testing.T) { pluginIDs: map[pluginCore.TaskType]string{corePluginType: corePluginType, corePluginDefaultType: corePluginDefaultType, k8sPluginType: k8sPluginType, k8sPluginDefaultType: k8sPluginDefaultType}, defaultPluginID: corePluginDefaultType, }, false}, + {"partial-default-task-types", + testPluginRegistry{ + core: []pluginCore.PluginEntry{corePluginEntry}, + k8s: []pluginK8s.PluginEntry{k8sPluginEntry}, + }, + []string{corePluginType, k8sPluginType}, + map[string]string{corePluginType: corePluginType}, + wantFields{ + pluginIDs: map[pluginCore.TaskType]string{ + corePluginType: corePluginType, + k8sPluginType: k8sPluginType, + }, + }, + false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {