Reduce indents of DumpAllNamespaceInfo()

During cleanup of DumpAllNamespaceInfo(), the code was a little
unreadable. This reduces the indents for the code readability.
This commit is contained in:
Kenichi Omichi 2019-08-28 23:03:43 +00:00
parent 41049fdf4b
commit 02a2d79bde

View File

@ -1769,15 +1769,16 @@ func DumpAllNamespaceInfo(c clientset.Interface, namespace string) {
// 2. there are so many of them that working with them are mostly impossible // 2. there are so many of them that working with them are mostly impossible
// So we dump them only if the cluster is relatively small. // So we dump them only if the cluster is relatively small.
maxNodesForDump := TestContext.MaxNodesToGather maxNodesForDump := TestContext.MaxNodesToGather
if nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}); err == nil { nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{})
if err != nil {
e2elog.Logf("unable to fetch node list: %v", err)
return
}
if len(nodes.Items) <= maxNodesForDump { if len(nodes.Items) <= maxNodesForDump {
dumpAllNodeInfo(c) dumpAllNodeInfo(c)
} else { } else {
e2elog.Logf("skipping dumping cluster info - cluster too large") e2elog.Logf("skipping dumping cluster info - cluster too large")
} }
} else {
e2elog.Logf("unable to fetch node list: %v", err)
}
} }
// byFirstTimestamp sorts a slice of events by first timestamp, using their involvedObject's name as a tie breaker. // byFirstTimestamp sorts a slice of events by first timestamp, using their involvedObject's name as a tie breaker.