Added printing heapster logs in case of monitoring.go e2e failure

This commit is contained in:
Piotr Szczesniak 2015-12-04 12:12:05 +01:00
parent a5100ef057
commit 38e6392eef

View File

@ -233,9 +233,24 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) {
return return
} }
if time.Since(startTime) >= testTimeout { if time.Since(startTime) >= testTimeout {
// temporary workaround to help debug issue #12765
printDebugInfo(c)
break break
} }
time.Sleep(sleepBetweenAttempts) time.Sleep(sleepBetweenAttempts)
} }
Failf("monitoring using heapster and influxdb test failed") Failf("monitoring using heapster and influxdb test failed")
} }
func printDebugInfo(c *client.Client) {
set := labels.Set{"k8s-app": "heapster"}
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{set.AsSelector()}}
podList, err := c.Pods(api.NamespaceSystem).List(options)
if err != nil {
Logf("Error while listing pods %v", err)
return
}
for _, pod := range podList.Items {
Logf("Kubectl output:\n%v", runKubectlOrDie("log", pod.Name, "--namespace=kube-system"))
}
}