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 @@ -683,16 +683,16 @@ EOF
683683
684684}
685685
686- # Gets logs of all containers in the default namespace . When passed -f, kubectl will
686+ # Gets logs of all containers in all namespaces . When passed -f, kubectl will
687687# keep running and capture new output. Prints the pid of all background processes.
688688# The caller must kill (when using -f) and/or wait for them.
689689#
690690# May be called multiple times and thus appends.
691691start_loggers () {
692- kubectl get pods -o go-template --template=' {{range .items}}{{.metadata.name}} {{range .spec.containers}}{{.name}} {{end}}{{"\n"}}{{end}}' | while read -r pod containers; do
692+ 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
693693 for container in $containers ; do
694- mkdir -p " ${ARTIFACTS} /$pod "
695- kubectl logs " $ @" " $pod " " $container " >> " ${ARTIFACTS} /$pod /$container .log" &
694+ mkdir -p " ${ARTIFACTS} /$namespace / $ pod"
695+ kubectl logs -n " $namespace " " $ @" " $pod " " $container " >> " ${ARTIFACTS} / $namespace /$pod /$container .log" &
696696 echo " $! "
697697 done
698698 done
You can’t perform that action at this time.
0 commit comments