summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-30 06:23:58 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-03 19:49:14 +0000
commit095aaaa639ab57c594bb80bfefbfaed2a2fdff92 (patch)
tree55db4600d1fe284fb591ee810d490b179afe16ad /libpod/options.go
parent6ba6ecf59b9204d36388de07b866f157a4d13957 (diff)
downloadpodman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.tar.gz
podman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.tar.bz2
podman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.zip
Allow users to specify logpath
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #135 Approved by: mheon
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 28962b4b5..965eb8cc5 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -602,6 +602,22 @@ func WithNetNS(portMappings []ocicni.PortMapping) CtrCreateOption {
}
}
+// WithLogPath sets the path to the log file
+func WithLogPath(path string) CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return ErrCtrFinalized
+ }
+ if path == "" {
+ return errors.Wrapf(ErrInvalidArg, "log path must be set")
+ }
+
+ ctr.config.LogPath = path
+
+ return nil
+ }
+}
+
// WithCgroupParent sets the Cgroup Parent of the new container
func WithCgroupParent(parent string) CtrCreateOption {
return func(ctr *Container) error {