Skip to content

Commit

Permalink
ExecRunnable: prevent logging on stderr when its not expected
Browse files Browse the repository at this point in the history
ExecRunnable is invoked by buildah and error from c/storage is logged to
stdout. This creates a drift between the between the behavior which is
generated by rootless and rootful buildah.

This corrects the behavior for rootless buildah so it has parity with
buildah invoked for root user.

This helps in containers/buildah#3804

Signed-off-by: Aditya R <[email protected]>
  • Loading branch information
flouthoc committed Mar 8, 2022
1 parent 8a6fceb commit d995ec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/unshare/unshare_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@ func ExecRunnable(cmd Runnable, cleanup func()) {
if exitError.ProcessState.Exited() {
if waitStatus, ok := exitError.ProcessState.Sys().(syscall.WaitStatus); ok {
if waitStatus.Exited() {
logrus.Errorf("%v", exitError)
logrus.Debugf("%v", exitError)
exit(waitStatus.ExitStatus())
}
if waitStatus.Signaled() {
logrus.Errorf("%v", exitError)
logrus.Debugf("%v", exitError)
exit(int(waitStatus.Signal()) + 128)
}
}
Expand Down

0 comments on commit d995ec4

Please sign in to comment.