Log actual return code, not the default value.

This commit is contained in:
Marcin Owsiany 2017-11-27 10:44:08 +01:00
parent e7ad6e6008
commit a8cfd22c16

View File

@ -2130,8 +2130,8 @@ func (b kubectlBuilder) Exec() (string, error) {
if err != nil {
var rc int = 127
if ee, ok := err.(*exec.ExitError); ok {
Logf("rc: %d", rc)
rc = int(ee.Sys().(syscall.WaitStatus).ExitStatus())
Logf("rc: %d", rc)
}
return "", uexec.CodeExitError{
Err: fmt.Errorf("error running %v:\nCommand stdout:\n%v\nstderr:\n%v\nerror:\n%v\n", cmd, cmd.Stdout, cmd.Stderr, err),