From 38e6392eef8a47ef6187d56d55bef826eed79128 Mon Sep 17 00:00:00 2001 From: Piotr Szczesniak Date: Fri, 4 Dec 2015 12:12:05 +0100 Subject: [PATCH] Added printing heapster logs in case of monitoring.go e2e failure --- test/e2e/monitoring.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/e2e/monitoring.go b/test/e2e/monitoring.go index 4f96fcf05d6..5a22369904e 100644 --- a/test/e2e/monitoring.go +++ b/test/e2e/monitoring.go @@ -233,9 +233,24 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) { return } if time.Since(startTime) >= testTimeout { + // temporary workaround to help debug issue #12765 + printDebugInfo(c) break } time.Sleep(sleepBetweenAttempts) } 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")) + } +}