mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #56401 from porridge/log-actual-rc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Log actual return code, not the default value. **What this PR does / why we need it**: Previously the code would log 127, no matter what, which is quite useless.. **Release note**: ```release-note NONE ```
This commit is contained in:
commit
1433716af4
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user