Merge "Docker log collection"

This commit is contained in:
Zuul 2023-02-23 22:04:18 +00:00 committed by Gerrit Code Review
commit 647eb821f4
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,13 @@
brctl show > {{ logs_dir }}/system/brctl-show.txt
ps aux --sort=-%mem > {{ logs_dir }}/system/ps.txt
dpkg -l > {{ logs_dir }}/system/packages.txt
CONTAINERS=($(docker ps -a --format {% raw %}'{{ .Names }}'{% endraw %} --filter label=zuul))
if [ ! -z "$CONTAINERS" ]; then
mkdir -p "{{ logs_dir }}/system/containers"
for CONTAINER in ${CONTAINERS}; do
docker logs "${CONTAINER}" > "{{ logs_dir }}/system/containers/${CONTAINER}.txt"
done
fi
args:
executable: /bin/bash
ignore_errors: True

View File

@ -21,7 +21,7 @@
path: "{{ logs_dir }}/pod-logs/failed-pods"
state: directory
- name: "retrieve all container logs, current and previous (if they exist)"
- name: "retrieve all kubernetes logs, current and previous (if they exist)"
shell: |-
set -e
PARALLELISM_FACTOR=2