Docker log collection
Collect logs for zuul jobs that use docker Change-Id: I8da05be5e84c0d565655721c4545ca7446794858
This commit is contained in:
parent
c925341518
commit
d132d708e9
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user