This repository was archived by the owner on Dec 6, 2024. It is now read-only.
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 @@ -683,16 +683,16 @@ EOF
683
683
684
684
}
685
685
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
687
687
# keep running and capture new output. Prints the pid of all background processes.
688
688
# The caller must kill (when using -f) and/or wait for them.
689
689
#
690
690
# May be called multiple times and thus appends.
691
691
start_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
693
693
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" &
696
696
echo " $! "
697
697
done
698
698
done
You can’t perform that action at this time.
0 commit comments