Fix podman logs
Change-Id: I7b1a5bef0cb1dc1dfad1c6c4ca486e6ead847f12
This commit is contained in:
parent
9951c44090
commit
2c0f416e3a
@ -7,8 +7,10 @@ copy_logs() {
|
|||||||
|
|
||||||
if [ "$CONTAINER_ENGINE" = "docker" ]; then
|
if [ "$CONTAINER_ENGINE" = "docker" ]; then
|
||||||
VOLUMES_DIR="/var/lib/docker/volumes"
|
VOLUMES_DIR="/var/lib/docker/volumes"
|
||||||
|
LOGS_TAIL_PARAMETER="all"
|
||||||
elif [ "$CONTAINER_ENGINE" = "podman" ]; then
|
elif [ "$CONTAINER_ENGINE" = "podman" ]; then
|
||||||
VOLUMES_DIR="/var/lib/containers/storage/volumes"
|
VOLUMES_DIR="/var/lib/containers/storage/volumes"
|
||||||
|
LOGS_TAIL_PARAMETER="-1"
|
||||||
else
|
else
|
||||||
echo "Invalid container engine: ${CONTAINER_ENGINE}"
|
echo "Invalid container engine: ${CONTAINER_ENGINE}"
|
||||||
exit 1
|
exit 1
|
||||||
@ -140,7 +142,7 @@ copy_logs() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for container in $(${CONTAINER_ENGINE} ps -a --format "{{.Names}}"); do
|
for container in $(${CONTAINER_ENGINE} ps -a --format "{{.Names}}"); do
|
||||||
${CONTAINER_ENGINE} logs --timestamps --tail all ${container} &> ${LOG_DIR}/container_logs/${container}.txt
|
${CONTAINER_ENGINE} logs --timestamps --tail=${LOGS_TAIL_PARAMETER} ${container} &> ${LOG_DIR}/container_logs/${container}.txt
|
||||||
done
|
done
|
||||||
|
|
||||||
# Rename files to .txt; this is so that when displayed via
|
# Rename files to .txt; this is so that when displayed via
|
||||||
|
Loading…
Reference in New Issue
Block a user