Skip to content

Commit bf6609a

Browse files
committed
fix timeout setting for ExecCommandOutputWithTimeout
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 9fad6cb commit bf6609a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util/cmd.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ func execCommandOutputWithTimeout(cmd string, args []string, stdinArgs []string,
8282

8383
// ExecCommandOutputWithTimeout executes ExecCommandOutput with the specified timeout
8484
func ExecCommandOutputWithTimeout(cmd string, args []string, timeout int) (string, int, error) {
85-
return execCommandOutputWithTimeout(cmd, args, []string{}, defaultTimeout)
85+
if timeout == 0 {
86+
timeout = defaultTimeout
87+
}
88+
return execCommandOutputWithTimeout(cmd, args, []string{}, timeout)
8689
}
8790
// ExecCommandOutput returns stdout and stderr in a single string, the return code, and error.
8891
// If the return code is not zero, error will not be nil.

0 commit comments

Comments
 (0)