diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-06 05:18:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 05:18:04 +0200 |
commit | f584d47a9d0c050c3b39793a73b0aba17b45e8ba (patch) | |
tree | 56f996fdefdfa8a83f6aba9eb98e6395364f8b60 /libpod/options.go | |
parent | ea02d9c2668207523611efac67a1699f776c9147 (diff) | |
parent | 348f2df0c09e2e3b517add5271e6eee583800be3 (diff) | |
download | podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.tar.gz podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.tar.bz2 podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.zip |
Merge pull request #7931 from rhatdan/size
Support max_size logoptions
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libpod/options.go b/libpod/options.go index f7190d0e3..1ffb78da9 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -328,20 +328,6 @@ func WithNoStore() RuntimeOption { } } -// WithMaxLogSize sets the maximum size of container logs. -// Positive sizes are limits in bytes, -1 is unlimited. -func WithMaxLogSize(limit int64) RuntimeOption { - return func(rt *Runtime) error { - if rt.valid { - return define.ErrRuntimeFinalized - } - - rt.config.Containers.LogSizeMax = limit - - return nil - } -} - // WithNoPivotRoot sets the runtime to use MS_MOVE instead of PIVOT_ROOT when // starting containers. func WithNoPivotRoot() RuntimeOption { @@ -543,6 +529,20 @@ func WithRuntimeFlags(runtimeFlags []string) RuntimeOption { // Container Creation Options +// WithMaxLogSize sets the maximum size of container logs. +// Positive sizes are limits in bytes, -1 is unlimited. +func WithMaxLogSize(limit int64) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrRuntimeFinalized + } + + ctr.config.LogSize = limit + + return nil + } +} + // WithShmDir sets the directory that should be mounted on /dev/shm. func WithShmDir(dir string) CtrCreateOption { return func(ctr *Container) error { |