-
Notifications
You must be signed in to change notification settings - Fork 261
read stdout for reading container name #745
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
read stdout for reading container name #745
Conversation
b8d3e09 to
6ce8852
Compare
Codecov Report
@@ Coverage Diff @@
## master #745 +/- ##
==========================================
+ Coverage 50.19% 50.43% +0.23%
==========================================
Files 100 102 +2
Lines 8531 8721 +190
==========================================
+ Hits 4282 4398 +116
- Misses 3421 3473 +52
- Partials 828 850 +22
Continue to review full report at Codecov.
|
pkg/containertools/runner.go
Outdated
| if exitErr, ok := err.(*exec.ExitError); ok { | ||
| msg = fmt.Sprintf("%s: %s", err, exitErr.Stderr) | ||
| } | ||
| r.logger.Errorf(msg) |
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.
nit: would logging the error here and then bubbling it up cause the message to occur twice in a row in the command output?
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.
Yeah, generally speaking, logging at the source and then returning an error can lead to duplicate error logging, so if we can double-check how we're handling logging at the various call sites, and instead bubble the error up that should be sufficient.
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.
Looks like it bubbles up, fixed the extra logging
dubee
left a comment
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.
@ankitathomas, can you also change the other occurrences of CombinedOutput in the Unpack method? It looks like there are two more calls in Unpack that combine stdout and stderr.
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.
@ankitathomas, any updates on this one?
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
6ce8852 to
6dc9024
Compare
The other uses of CombinedOutput are only ever used as error messages, unlike the one instance fixed here that was using the CombinedOutput to look for a container name on stdout. The issue should go away with just this one fixed. |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ankitathomas, joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Read container names from only stdout to avoid podman warnings on stderr.
Closes #689