Merge pull request #118141 from dims/grab-logs-from-all-the-containers-when-DNS-related-tests-fail

Grab logs from all the containers when DNS related tests fail
This commit is contained in:
Kubernetes Prow Robot 2023-05-19 15:30:19 -07:00 committed by GitHub
commit 60e747896a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,6 +487,14 @@ func assertFilesContain(ctx context.Context, fileNames []string, fileDir string,
return true, nil
}
framework.Logf("Lookups using %s/%s failed for: %v\n", pod.Namespace, pod.Name, failed)
// grab logs from all the containers
for _, container := range pod.Spec.Containers {
logs, err := e2epod.GetPodLogs(ctx, client, pod.Namespace, pod.Name, container.Name)
framework.ExpectNoError(err)
framework.Logf("Pod client logs for %s: %s", container.Name, logs)
}
return false, nil
}))
framework.ExpectEqual(len(failed), 0)