summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-01-04 11:16:40 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-01-14 10:22:18 +0100
commit50c86ae3892a3708afb00189fea52547cb60572f (patch)
tree47893987cef11882b6fc7832ee9d478d781a01d1 /libpod/options.go
parent650cf122e1b33f4d8f4426ee1cc1a4bf00c14798 (diff)
downloadpodman-50c86ae3892a3708afb00189fea52547cb60572f.tar.gz
podman-50c86ae3892a3708afb00189fea52547cb60572f.tar.bz2
podman-50c86ae3892a3708afb00189fea52547cb60572f.zip
oci: allow to define multiple OCI runtimes
we can define multiple OCI runtimes that can be chosen with --runtime. in libpod.conf is possible to specify them with: [runtimes] foo = [ "/usr/bin/foo", "/usr/sbin/foo", ] bar = [ "/usr/bin/foo", "/usr/sbin/foo", ] If the argument to --runtime is an absolute path then it is used directly without any lookup in the configuration. Closes: https://github.com/containers/libpod/issues/1750 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 65a8a91d3..d965c058e 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -137,21 +137,17 @@ func WithStateType(storeType RuntimeStateStore) RuntimeOption {
}
// WithOCIRuntime specifies an OCI runtime to use for running containers.
-func WithOCIRuntime(runtimePath string) RuntimeOption {
+func WithOCIRuntime(runtime string) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return ErrRuntimeFinalized
}
- if runtimePath == "" {
+ if runtime == "" {
return errors.Wrapf(ErrInvalidArg, "must provide a valid path")
}
- rt.config.OCIRuntimes = []OCIRuntimePath{
- {
- Paths: []string{runtimePath},
- },
- }
+ rt.config.OCIRuntime = runtime
return nil
}