mirror of
https://github.com/containers/podman.git
synced 2026-11-02 14:14:20 -05:00
As of conmon 2.2.0, conmon supports log file rotation via --log-rotate
and --log-max-files. This commit exposes those options through Podman's
REST API, specgen model, CLI (--log-opt), and libpod container runtime
so that users managing containers through the API can configure conmon
log rotation settings.
New --log-opt keys accepted:
max-file=<n> Maximum number of rotated log backup files.
Setting this implicitly enables log rotation.
log-rotate=true|false Explicitly enable or disable log rotation.
Options flow:
CLI / REST API
-> specgenutil parses and validates new opts
-> specgen.LogConfig.Options carries max-file and log-rotate
-> generate.MakeContainerFromSpec calls WithLogMaxFiles/WithLogRotate
-> libpod stores LogMaxFiles and LogRotate in ContainerConfig
-> oci_conmon_common.go passes --log-max-files/--log-rotate to conmon
podman inspect now reflects rotation settings in HostConfig.LogConfig.Config.
Fixes: https://github.com/containers/podman/issues/29543
Signed-off-by: prabhat-kumar96 <prabhatmathur9927@gmail.com>