Skip to content

Commit

Permalink
log dynamically applied config on mapping errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Feb 9, 2024
1 parent 9611c8e commit b53c6fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/coordinator/test/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ func (ts *TaskScheduler) ExecuteTask(ctx context.Context, task types.Task, taskW
err := task.LoadConfig()
if err != nil {
task.Logger().Errorf("config validation failed: %v", err)
ts.setTaskResult(task, types.TaskResultFailure, false)

return fmt.Errorf("task %v config validation failed: %w", task.Name(), err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/coordinator/vars/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (v *Variables) ConsumeVars(config interface{}, consumeMap map[string]string

err = yaml.Unmarshal(applyYaml, config)
if err != nil {
return fmt.Errorf("could not unmarshal dynamic config vars")
return fmt.Errorf("could not unmarshal dynamic config vars:\n%v", string(applyYaml))
}

return nil
Expand Down

0 comments on commit b53c6fc

Please sign in to comment.