Skip to content

Commit 6de3fab

Browse files
committed
output stdout and stderr from custom commands
1 parent 9b2d0be commit 6de3fab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/healthchecker/health_checker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ func execCommand(timeout time.Duration, command string, args ...string) (string,
167167
ctx, cancel := context.WithTimeout(context.Background(), timeout)
168168
defer cancel()
169169
cmd := exec.CommandContext(ctx, command, args...)
170-
out, err := cmd.Output()
170+
out, err := cmd.CombinedOutput()
171171
if err != nil {
172172
glog.Infof("command %v failed: %v, %v\n", cmd, err, out)
173173
return "", err
174174
}
175+
175176
return strings.TrimSuffix(string(out), "\n"), nil
176177
}

0 commit comments

Comments
 (0)