summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container_create.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-10-05 16:33:09 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-10-05 17:51:45 -0400
commit348f2df0c09e2e3b517add5271e6eee583800be3 (patch)
treeeac3576a5ea40c71de7a8390fbd772a369219d8b /pkg/specgen/generate/container_create.go
parent1b16fcfd14b9e761849e53ac2b83c964ad8ac5a9 (diff)
downloadpodman-348f2df0c09e2e3b517add5271e6eee583800be3.tar.gz
podman-348f2df0c09e2e3b517add5271e6eee583800be3.tar.bz2
podman-348f2df0c09e2e3b517add5271e6eee583800be3.zip
Support max_size logoptions
Docker supports log-opt max_size and so does conmon (ALthough poorly). Adding support for this allows users to at least make sure their containers logs do not become a DOS vector. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r--pkg/specgen/generate/container_create.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 147450703..105e36bc6 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -260,6 +260,9 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
if len(s.LogConfiguration.Path) > 0 {
options = append(options, libpod.WithLogPath(s.LogConfiguration.Path))
}
+ if s.LogConfiguration.Size > 0 {
+ options = append(options, libpod.WithMaxLogSize(s.LogConfiguration.Size))
+ }
if len(s.LogConfiguration.Options) > 0 && s.LogConfiguration.Options["tag"] != "" {
// Note: I'm really guessing here.
options = append(options, libpod.WithLogTag(s.LogConfiguration.Options["tag"]))