Skip to content

Commit

Permalink
fix(controller): Wrong validate order when validate DAG task's argument
Browse files Browse the repository at this point in the history
Signed-off-by: BOOK <book78987book@gmail.com>
  • Loading branch information
book987 committed Jun 22, 2021
1 parent bae2188 commit 2293875
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 2293875

Please sign in to comment.