mirror of
https://github.com/containers/podman.git
synced 2025-08-26 03:01:31 +08:00
Fix podman inspect
to correctly handle log_size_max
When generating Conmon's command line, we read containers.conf to get log_size_max and used it if the container didn't override it. However, `podman inspect` only reads from the container's own config, and ignores containers.conf. Unify the way we determine maximum log size with a single function and use it for both inspect and containers.conf, and add a test for this behavior. Fixes https://issues.redhat.com/browse/RHEL-96776 Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -1342,10 +1342,7 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p
|
||||
logrus.Debugf("%s messages will be logged to syslog", r.conmonPath)
|
||||
args = append(args, "--syslog")
|
||||
|
||||
size := r.logSizeMax
|
||||
if ctr.config.LogSize > 0 {
|
||||
size = ctr.config.LogSize
|
||||
}
|
||||
size := ctr.LogSizeMax()
|
||||
if size > 0 {
|
||||
args = append(args, "--log-size-max", strconv.FormatInt(size, 10))
|
||||
}
|
||||
|
Reference in New Issue
Block a user