Add log size max configuration

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2017-09-25 15:27:21 -07:00
parent a8ee86b1cc
commit c7f5347673
2 changed files with 15 additions and 0 deletions

View file

@ -108,6 +108,10 @@ hooks_dir_path = "{{ .HooksDirPath }}"
# pids_limit is the number of processes allowed in a container
pids_limit = {{ .PidsLimit }}
# log_size_max is the max limit for the container log size in bytes.
# Negative values indicate that no limit is imposed.
log_size_max = {{ .LogSizeMax }}
# The "crio.image" table contains settings pertaining to the
# management of OCI images.
[crio.image]

View file

@ -51,6 +51,10 @@ const (
// DefaultPidsLimit is the default value for maximum number of processes
// allowed inside a container
DefaultPidsLimit = 1024
// DefaultLogSizeMax is the default value for the maximum log size
// allowed for a container. Negative values mean that no limit is imposed.
DefaultLogSizeMax = -1
)
// This structure is necessary to fake the TOML tables when parsing,
@ -145,6 +149,12 @@ type RuntimeConfig struct {
// by the cgroup process number controller.
PidsLimit int64 `toml:"pids_limit"`
// LogSizeMax is the maximum number of bytes after which the log file
// will be truncated. It can be expressed as a human-friendly string
// that is parsed to bytes.
// Negative values indicate that the log file won't be truncated.
LogSizeMax int64 `toml:"log_size_max"`
// ContainerExitsDir is the directory in which container exit files are
// written to by conmon.
ContainerExitsDir string `toml:"container_exits_dir"`
@ -274,6 +284,7 @@ func DefaultConfig() *Config {
PidsLimit: DefaultPidsLimit,
ContainerExitsDir: containerExitsDir,
HooksDirPath: DefaultHooksDirPath,
LogSizeMax: DefaultLogSizeMax,
},
ImageConfig: ImageConfig{
DefaultTransport: defaultTransport,