Skip to content

Commit 5a8561a

Browse files
authored
include logs for init containers as well (#467)
1 parent 0df6789 commit 5a8561a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/collect/cluster_resources.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ func ClusterResources(c *Collector, clusterResourcesCollector *troubleshootv1bet
7474
output.SaveResult(c.BundlePath, "cluster-resources/pods-errors.json", marshalErrors(podErrors))
7575

7676
for _, pod := range failedPods {
77-
for _, container := range pod.Spec.Containers {
77+
allContainers := append(pod.Spec.InitContainers, pod.Spec.Containers...)
78+
for _, container := range allContainers {
7879
logsRoot := path.Join(c.BundlePath, "cluster-resources", "pods", pod.Namespace, "logs")
7980
limits := &troubleshootv1beta2.LogLimits{
8081
MaxLines: 500,

0 commit comments

Comments
 (0)