summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-27 22:31:18 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-06 01:21:09 +0000
commitabd2ae7a0ca8ee1c292e08cac4818fc8b7f4c384 (patch)
tree73d42dfdf4e200a14611c7e5d370e86abb3fca53 /libpod/options.go
parentff9da1fb3f4122276cf9f78cf0ae4a4d461f78da (diff)
downloadpodman-abd2ae7a0ca8ee1c292e08cac4818fc8b7f4c384.tar.gz
podman-abd2ae7a0ca8ee1c292e08cac4818fc8b7f4c384.tar.bz2
podman-abd2ae7a0ca8ee1c292e08cac4818fc8b7f4c384.zip
Change conmon and runtime paths to arrays
This allows more graceful handling of multiple paths in a config file. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #430 Approved by: rhatdan
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go15
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
}
}