mirror of
https://github.com/containers/podman.git
synced 2025-10-15 10:16:28 +08:00
Fix HealthCheck log destination, count, and size defaults
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: https://github.com/containers/podman/issues/25473 Fixes: https://issues.redhat.com/browse/RHEL-83262 Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
@ -1536,7 +1536,7 @@ func WithHealthCheckLogDestination(destination string) CtrCreateOption {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ctr.config.HealthLogDestination = dest
|
||||
ctr.config.HealthLogDestination = &dest
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@ -1547,7 +1547,7 @@ func WithHealthCheckMaxLogCount(maxLogCount uint) CtrCreateOption {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
ctr.config.HealthMaxLogCount = maxLogCount
|
||||
ctr.config.HealthMaxLogCount = &maxLogCount
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@ -1558,7 +1558,7 @@ func WithHealthCheckMaxLogSize(maxLogSize uint) CtrCreateOption {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
ctr.config.HealthMaxLogSize = maxLogSize
|
||||
ctr.config.HealthMaxLogSize = &maxLogSize
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user