mirror of
https://github.com/containers/podman.git
synced 2025-12-04 20:28:40 +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
@@ -773,3 +773,15 @@ func stringSlicetoUint32Slice(inputSlice []string) ([]uint32, error) {
|
||||
}
|
||||
return outputSlice, nil
|
||||
}
|
||||
|
||||
func getLoggingPath(opts []string) string {
|
||||
for _, opt := range opts {
|
||||
arr := strings.SplitN(opt, "=", 2)
|
||||
if len(arr) == 2 {
|
||||
if strings.TrimSpace(arr[0]) == "path" {
|
||||
return strings.TrimSpace(arr[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -608,6 +608,10 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er
|
||||
if len(c.HostAdd) > 0 {
|
||||
options = append(options, libpod.WithHosts(c.HostAdd))
|
||||
}
|
||||
logPath := getLoggingPath(c.LogDriverOpt)
|
||||
if logPath != "" {
|
||||
options = append(options, libpod.WithLogPath(logPath))
|
||||
}
|
||||
|
||||
options = append(options, libpod.WithPrivileged(c.Privileged))
|
||||
return options, nil
|
||||
|
||||
Reference in New Issue
Block a user