mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Added printing heapster logs in case of monitoring.go e2e failure
This commit is contained in:
parent
a5100ef057
commit
38e6392eef
@ -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"))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user