Skip to content

Commit

Permalink
fix: exit code always be '0' in windows container. Fixes argoproj#9797 (
Browse files Browse the repository at this point in the history
argoproj#9807)

Signed-off-by: wsj_0000 <[email protected]>
  • Loading branch information
wsj0000 committed Oct 18, 2022
1 parent af8347c commit a752a58
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion workflow/executor/os-specific/signal_windows.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package os_specific

import (
"fmt"
"os"
"syscall"
)
Expand All @@ -25,6 +26,16 @@ func Setpgid(a *syscall.SysProcAttr) {
}

func Wait(process *os.Process) error {
_, err := process.Wait()
stat, err := process.Wait()
if stat.ExitCode() != 0 {
var errStr string
if err != nil {
errStr = err.Error()
} else {
errStr = "<nil>"
}

return fmt.Errorf("exit with non-zero code. exit-code: %d, error:%s", stat.ExitCode(), errStr)
}
return err
}

0 comments on commit a752a58

Please sign in to comment.