fix: restore container logging compatibility and normalize legacy policies

This commit is contained in:
elky
2026-09-08 11:43:51 +08:00
parent cf8ea19856
commit c7e403b410
17 changed files with 849 additions and 149 deletions
+28
View File
@@ -0,0 +1,28 @@
FROM ubuntu:24.04
COPY root-logging-tests /usr/local/bin/root-logging-tests
RUN set -eu; \
bucket="$(date -u +%Y-%m-%d)"; \
for entrypoint in standard reloadable; do \
for destination in file both; do \
for format in pretty json; do \
for owner in 0 1000 65532 new; do \
directory="/logs/${entrypoint}-${destination}-${format}-${owner}"; \
mkdir -p "${directory}"; \
chown 1000:1000 "${directory}"; \
chmod 0750 "${directory}"; \
if [ "${owner}" != new ]; then \
logfile="${directory}/root-logging-test.${bucket}.log"; \
printf 'historical log\n' >"${logfile}"; \
chown "${owner}:${owner}" "${logfile}"; \
chmod 0640 "${logfile}"; \
fi; \
done; \
done; \
done; \
done
USER 0:0
VOLUME ["/logs"]
ENTRYPOINT ["/usr/local/bin/root-logging-tests", "--ignored", "--exact", "root_appends_to_existing_logs_without_changing_ownership", "--nocapture"]