Skip to content

Commit f41c135

Browse files
committed
prow.sh: also log output of system containers
Depending on the error, those logs are needed to debug failures.
1 parent a53bd4c commit f41c135

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

prow.sh

+4-4
Original file line numberDiff line numberDiff 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.
685685
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
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

0 commit comments

Comments
 (0)