Grab logs from all the containers when DNS related tests fail

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2023-05-19 17:23:13 -04:00
parent 589d6f3886
commit ec8d94f205
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

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)