mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Allow users to specify logpath
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #135 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
6ba6ecf59b
commit
095aaaa639
@ -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 {
|
||||
|
Reference in New Issue
Block a user