include logs for init containers as well (#467)

This commit is contained in:
Salah Aldeen Al Saleh
2021-10-27 10:20:55 -07:00
committed by GitHub
parent 0df678929a
commit 5a8561a31f

View File

@@ -74,7 +74,8 @@ func ClusterResources(c *Collector, clusterResourcesCollector *troubleshootv1bet
output.SaveResult(c.BundlePath, "cluster-resources/pods-errors.json", marshalErrors(podErrors))
for _, pod := range failedPods {
for _, container := range pod.Spec.Containers {
allContainers := append(pod.Spec.InitContainers, pod.Spec.Containers...)
for _, container := range allContainers {
logsRoot := path.Join(c.BundlePath, "cluster-resources", "pods", pod.Namespace, "logs")
limits := &troubleshootv1beta2.LogLimits{
MaxLines: 500,