Add init containers to dump info

Kubernetes-commit: a024ac14ef14da1c972edc6589de81405f17bc76
This commit is contained in:
zhouya0 2020-02-19 20:47:34 +08:00 committed by Kubernetes Publisher
parent f5fd42308c
commit d23f51983a
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)
}