Dumping federation events if federation test failed

This commit is contained in:
nikhiljindal
2016-09-20 17:25:51 -07:00
parent 2580157597
commit bbb27cde10
4 changed files with 32 additions and 6 deletions

View File

@@ -356,10 +356,15 @@ func (f *Framework) AfterEach() {
// Print events if the test failed.
if CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
DumpAllNamespaceInfo(f.Client, f.Namespace.Name)
// Pass both unversioned client and and versioned clientset, till we have removed all uses of the unversioned client.
DumpAllNamespaceInfo(f.Client, f.Clientset_1_5, f.Namespace.Name)
By(fmt.Sprintf("Dumping a list of prepulled images on each node"))
LogContainersInPodsWithLabels(f.Client, api.NamespaceSystem, ImagePullerLabels, "image-puller")
if f.federated {
// Dump federation events in federation namespace.
DumpEventsInNamespace(func(opts api.ListOptions, ns string) (*v1.EventList, error) {
return f.FederationClientset_1_4.Core().Events(ns).List(opts)
}, f.FederationNamespace.Name)
// Print logs of federation control plane pods (federation-apiserver and federation-controller-manager)
LogPodsWithLabels(f.Client, "federation", map[string]string{"app": "federated-cluster"})
// Print logs of kube-dns pod