diff options
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libpod/options.go b/libpod/options.go index 031f4f705..8bc5a541d 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -733,7 +733,9 @@ func WithExitCommand(exitCommand []string) CtrCreateOption { return define.ErrCtrFinalized } - ctr.config.ExitCommand = append(exitCommand, ctr.ID()) + ctr.config.ExitCommand = exitCommand + ctr.config.ExitCommand = append(ctr.config.ExitCommand, ctr.ID()) + return nil } } @@ -1059,6 +1061,23 @@ func WithLogPath(path string) CtrCreateOption { } } +// WithLogTag sets the tag to the log file. +func WithLogTag(tag string) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrCtrFinalized + } + if tag == "" { + return errors.Wrapf(define.ErrInvalidArg, "log tag must be set") + } + + ctr.config.LogTag = tag + + return nil + } + +} + // WithNoCgroups disables the creation of CGroups for the new container. func WithNoCgroups() CtrCreateOption { return func(ctr *Container) error { |