diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index 9528c1482..62fae227b 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -201,9 +201,6 @@ func (s *scheduler) createTask(sch schedule.Schedule, wfMap *wmap.WorkflowMap, s return nil, te } - // Bind plugin content type selections in workflow - err = wf.BindPluginContentTypes(s.metricManager) - // validate plugins and metrics mts, plugins := s.gatherMetricsAndPlugins(wf) errs := s.metricManager.ValidateDeps(mts, plugins) @@ -212,6 +209,15 @@ func (s *scheduler) createTask(sch schedule.Schedule, wfMap *wmap.WorkflowMap, s return nil, te } + // Bind plugin content type selections in workflow + err = wf.BindPluginContentTypes(s.metricManager) + if err != nil { + te.errs = append(te.errs, serror.New(err)) + f := buildErrorsLog(te.Errors(), logger) + f.Error("unable to bind plugin content types") + return nil, te + } + // Create the task object task := newTask(sch, wf, s.workManager, s.metricManager, s.eventManager, opts...) diff --git a/scheduler/workflow.go b/scheduler/workflow.go index d30335294..4d146ed42 100644 --- a/scheduler/workflow.go +++ b/scheduler/workflow.go @@ -231,8 +231,7 @@ type wfContentTypes map[string]map[string][]string // BindPluginContentTypes func (s *schedulerWorkflow) BindPluginContentTypes(mm managesPluginContentTypes) error { - bindPluginContentTypes(s.publishNodes, s.processNodes, mm, []string{plugin.SnapGOBContentType}) - return nil + return bindPluginContentTypes(s.publishNodes, s.processNodes, mm, []string{plugin.SnapGOBContentType}) } func bindPluginContentTypes(pus []*publishNode, prs []*processNode, mm managesPluginContentTypes, lct []string) error { @@ -271,7 +270,9 @@ func bindPluginContentTypes(pus []*publishNode, prs []*processNode, mm managesPl } } //continue the walk down the nodes - bindPluginContentTypes(pr.PublishNodes, pr.ProcessNodes, mm, rct) + if err := bindPluginContentTypes(pr.PublishNodes, pr.ProcessNodes, mm, rct); err != nil { + return err + } } for _, pu := range pus { act, _, err := mm.GetPluginContentTypes(pu.Name(), core.PublisherPluginType, pu.Version())