diff options
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libpod/options.go b/libpod/options.go index 56e8fa203..7cbe9afb4 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -101,7 +101,11 @@ func WithOCIRuntime(runtimePath string) RuntimeOption { return ErrRuntimeFinalized } - rt.config.RuntimePath = runtimePath + if runtimePath == "" { + return errors.Wrapf(ErrInvalidArg, "must provide a valid path") + } + + rt.config.RuntimePath = []string{runtimePath} return nil } @@ -114,10 +118,13 @@ func WithConmonPath(path string) RuntimeOption { if rt.valid { return ErrRuntimeFinalized } - // TODO Once libkpod is eliminated, "" should throw an error - if path != "" { - rt.config.ConmonPath = path + + if path == "" { + return errors.Wrapf(ErrInvalidArg, "must provide a valid path") } + + rt.config.ConmonPath = []string{path} + return nil } } |