mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #37583 from mtaufen/test-fr-ssh-issue
Automatic merge from submit-queue Fix nil pointer dereference in test framework Checking the `result.Code` prior to `err` in the if statement causes a panic if result is `nil`. It turns out the formatting of the error is already in `IssueSSHCommandWithResult`, so removing redundant code is enough to fix the issue. Logging the SSH result was also redundant, so I removed that as well.
This commit is contained in:
commit
320b30479f
@ -3550,16 +3550,10 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult,
|
||||
}
|
||||
|
||||
func IssueSSHCommand(cmd, provider string, node *v1.Node) error {
|
||||
result, err := IssueSSHCommandWithResult(cmd, provider, node)
|
||||
if result != nil {
|
||||
LogSSHResult(*result)
|
||||
_, err := IssueSSHCommandWithResult(cmd, provider, node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if result.Code != 0 || err != nil {
|
||||
return fmt.Errorf("failed running %q: %v (exit code %d)",
|
||||
cmd, err, result.Code)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user