-
Notifications
You must be signed in to change notification settings - Fork 0
fix: log stderr as well #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -261,6 +261,9 @@ func (e *CommandCustodianExecutor) Execute(ctx context.Context, req CustodianExe | |
| if err != nil { | ||
| result.Err = fmt.Errorf("custodian execution failed: %w", err) | ||
| result.Errors = append(result.Errors, result.Err.Error()) | ||
| if result.Stderr != "" { | ||
| result.Errors = append(result.Errors, result.Stderr) | ||
| } | ||
|
Comment on lines
+264
to
+266
|
||
| } | ||
| if runErr := runCtx.Err(); runErr != nil { | ||
| // Avoid duplicating context timeout/cancel errors when cmd.Run already | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces new behavior (stderr is added to
result.Errorswhencmd.Run()fails), but there is no test exercising the failure path with non-empty stderr to ensure it’s included (and to lock in expectations around formatting/truncation). Please add a unit test in the existingTestCommandCustodianExecutorsuite for a script that exits non-zero and writes to stderr.