File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -677,16 +677,16 @@ EOF
677677
678678}
679679
680- # Gets logs of all containers in the default namespace . When passed -f, kubectl will
680+ # Gets logs of all containers in all namespaces . When passed -f, kubectl will
681681# keep running and capture new output. Prints the pid of all background processes.
682682# The caller must kill (when using -f) and/or wait for them.
683683#
684684# May be called multiple times and thus appends.
685685start_loggers () {
686- kubectl get pods -o go-template --template=' {{range .items}}{{.metadata.name}} {{range .spec.containers}}{{.name}} {{end}}{{"\n"}}{{end}}' | while read -r pod containers; do
686+ kubectl get pods --all-namespaces - o go-template --template=' {{range .items}}{{.metadata.namespace}} {{.metadata. name}} {{range .spec.containers}}{{.name}} {{end}}{{"\n"}}{{end}}' | while read -r namespace pod containers; do
687687 for container in $containers ; do
688- mkdir -p " ${ARTIFACTS} /$pod "
689- kubectl logs " $ @" " $pod " " $container " >> " ${ARTIFACTS} /$pod /$container .log" &
688+ mkdir -p " ${ARTIFACTS} /$namespace / $ pod"
689+ kubectl logs -n " $namespace " " $ @" " $pod " " $container " >> " ${ARTIFACTS} / $namespace /$pod /$container .log" &
690690 echo " $! "
691691 done
692692 done
You can’t perform that action at this time.
0 commit comments