Skip to content

Commit

Permalink
ExecResource: fix bug in return code handling (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
adjackura authored Mar 16, 2021
1 parent e604bb7 commit 0fdd9dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/exec_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ func (e *execResource) run(ctx context.Context, name string, execR *agentendpoin
}

stdout, stderr, err := runner.Run(ctx, exec.Command(cmd, args...))
code := -1
code := 0
if err != nil {
code = -1
if v, ok := err.(*exec.ExitError); ok {
code = v.ExitCode()
}
Expand Down

0 comments on commit 0fdd9dc

Please sign in to comment.