Skip to content

Commit

Permalink
fix(controller): Wrong validate order when validate DAG task's argume…
Browse files Browse the repository at this point in the history
…nt (#6190)

Signed-off-by: BOOK <book78987book@gmail.com>
  • Loading branch information
book987 authored and alexec committed Jun 28, 2021
1 parent 18b2371 commit 99b42eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workflow/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,14 +1242,14 @@ func (ctx *templateValidationCtx) validateDAG(scope map[string]interface{}, tmpl
if err != nil {
return errors.Errorf(errors.CodeBadRequest, "templates.%s.tasks.%s %s", tmpl.Name, task.Name, err.Error())
}
err = validateDAGTaskArgumentDependency(task.Arguments, ancestry)
if err != nil {
return errors.Errorf(errors.CodeBadRequest, "templates.%s.tasks.%s %s", tmpl.Name, task.Name, err.Error())
}
err = validateArguments(fmt.Sprintf("templates.%s.tasks.%s.arguments.", tmpl.Name, task.Name), task.Arguments)
if err != nil {
return err
}
err = validateDAGTaskArgumentDependency(task.Arguments, ancestry)
if err != nil {
return errors.Errorf(errors.CodeBadRequest, "templates.%s.tasks.%s %s", tmpl.Name, task.Name, err.Error())
}
// Validate the template again with actual arguments.
_, err = ctx.validateTemplateHolder(&task, tmplCtx, &task.Arguments)
if err != nil {
Expand Down

0 comments on commit 99b42eb

Please sign in to comment.