Merge pull request #88324 from zhouya0/add_init_containers_to_dump_info

Add init containers log to cluster dump info

Kubernetes-commit: 0e9a8481aa8b2974268476ed4971c1644f7e0c6d
This commit is contained in:
Kubernetes Publisher 2020-02-21 18:31:40 -08:00
commit ef98d6e54f
1 changed files with 4 additions and 0 deletions

View File

@ -286,9 +286,13 @@ func (o *ClusterInfoDumpOptions) Run() error {
for ix := range pods.Items {
pod := &pods.Items[ix]
initcontainers := pod.Spec.InitContainers
containers := pod.Spec.Containers
writer := setupOutputWriter(o.OutputDir, o.Out, path.Join(namespace, pod.Name, "logs"), ".txt")
for i := range initcontainers {
printContainer(writer, initcontainers[i], pod)
}
for i := range containers {
printContainer(writer, containers[i], pod)
}