Commit f41c135 1 parent a53bd4c commit f41c135 Copy full SHA for f41c135
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -677,16 +677,16 @@ EOF
677
677
678
678
}
679
679
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
681
681
# keep running and capture new output. Prints the pid of all background processes.
682
682
# The caller must kill (when using -f) and/or wait for them.
683
683
#
684
684
# May be called multiple times and thus appends.
685
685
start_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
687
687
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" &
690
690
echo " $! "
691
691
done
692
692
done
You can’t perform that action at this time.
0 commit comments