e2e: Fix error where pods not logged

This was changed recently in #84640, but result must be pre-populated.

Example error:

`Nov  6 00:18:05.296: INFO: Unable to retrieve kubelet pods for node master-us-central1-c-t81q: expected pointer, but got nil`
This commit is contained in:
Justin SB 2019-11-05 22:48:01 -05:00
parent 0c0408c790
commit 5031a2a049
No known key found for this signature in database
GPG Key ID: 8DEC5C8217494E37

View File

@ -1311,7 +1311,6 @@ func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, logFunc func(f
// getKubeletPods retrieves the list of pods on the kubelet.
func getKubeletPods(c clientset.Interface, node string) (*v1.PodList, error) {
var result *v1.PodList
var client restclient.Result
finished := make(chan struct{}, 1)
go func() {
@ -1327,6 +1326,7 @@ func getKubeletPods(c clientset.Interface, node string) (*v1.PodList, error) {
}()
select {
case <-finished:
result := &v1.PodList{}
if err := client.Into(result); err != nil {
return &v1.PodList{}, err
}