Skip to content

Commit

Permalink
fix timeout setting for ExecCommandOutputWithTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Jun 14, 2021
1 parent 830c574 commit 6d6da97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ func execCommandOutputWithTimeout(cmd string, args []string, stdinArgs []string,

// ExecCommandOutputWithTimeout executes ExecCommandOutput with the specified timeout
func ExecCommandOutputWithTimeout(cmd string, args []string, timeout int) (string, int, error) {
return execCommandOutputWithTimeout(cmd, args, []string{}, defaultTimeout)
if timeout == 0 {
timeout = defaultTimeout
}
return execCommandOutputWithTimeout(cmd, args, []string{}, timeout)
}

// ExecCommandOutput returns stdout and stderr in a single string, the return code, and error.
// If the return code is not zero, error will not be nil.
// Stdout and Stderr are dumped to the log at the debug level.
Expand Down

0 comments on commit 6d6da97

Please sign in to comment.