Merge pull request #31516 from sttts/sttts-e2e-CheckConnectivityToHost-logs

Automatic merge from submit-queue

e2e: log wget output on CheckConnectivityToHost error

Log output might help to diagnose e2e flakes, whether they are caused by dns issues or connection timeouts.

Might help with flake https://github.com/kubernetes/kubernetes/issues/28188.
This commit is contained in:
Kubernetes Submit Queue
2016-08-30 06:27:28 -07:00
committed by GitHub

View File

@@ -4689,7 +4689,18 @@ func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeo
return err
}
defer podClient.Delete(podName, nil)
return WaitForPodSuccessInNamespace(f.Client, podName, contName, f.Namespace.Name)
err = WaitForPodSuccessInNamespace(f.Client, podName, contName, f.Namespace.Name)
if err != nil {
logs, logErr := GetPodLogs(f.Client, f.Namespace.Name, pod.Name, contName)
if logErr != nil {
Logf("Warning: Failed to get logs from pod %q: %v", pod.Name, logErr)
} else {
Logf("pod %s/%s \"wget\" logs:\n%s", f.Namespace.Name, pod.Name, logs)
}
}
return err
}
// CoreDump SSHs to the master and all nodes and dumps their logs into dir.