Merge pull request #26163 from sttts/sttts-flake-21484-pod-log

Automatic merge from submit-queue

Flake 21484: retrieve pod log during e2e error

Print the pod log when an error occurs in

> Proxy version 1 should proxy through a service and a pod [Conformance]

e2e test. This will help to understand flake https://github.com/kubernetes/kubernetes/issues/21484 better.
This commit is contained in:
k8s-merge-robot 2016-05-25 18:54:57 -07:00
commit 3ac9769d49

View File

@ -243,6 +243,13 @@ func proxyContext(version string) {
wg.Wait()
if len(errors) != 0 {
body, err := f.Client.Pods(f.Namespace.Name).GetLogs(pods[0].Name, &api.PodLogOptions{}).Do().Raw()
if err != nil {
framework.Logf("Error getting logs for pod %s: %v", pods[0].Name, err)
} else {
framework.Logf("Pod %s has the following error logs: %s", pods[0].Name, body)
}
Fail(strings.Join(errors, "\n"))
}
})