diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-01 10:04:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-01 10:04:19 +0200 |
commit | ccf4ec295b9a144740b07a202432aa34a7cce3de (patch) | |
tree | 4859563846256c2a7f30b7637bfb4651f967f6fa /libpod/oci.go | |
parent | 39de184b8bfb14954f77190f0e6127c1ddc363c0 (diff) | |
parent | 7dfaef7766871e5fd914eb0373b26db29df5bb46 (diff) | |
download | podman-ccf4ec295b9a144740b07a202432aa34a7cce3de.tar.gz podman-ccf4ec295b9a144740b07a202432aa34a7cce3de.tar.bz2 podman-ccf4ec295b9a144740b07a202432aa34a7cce3de.zip |
Merge pull request #3671 from openSUSE/runtime-path-discovery
Add runtime and conmon path discovery
Diffstat (limited to 'libpod/oci.go')
-rw-r--r-- | libpod/oci.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 193e66aaf..2eb004b84 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -106,8 +106,19 @@ func newOCIRuntime(name string, paths []string, conmonPath string, runtimeCfg *R } foundPath = true runtime.path = path + logrus.Debugf("using runtime %q", path) break } + + // Search the $PATH as last fallback + if !foundPath { + if foundRuntime, err := exec.LookPath(name); err == nil { + foundPath = true + runtime.path = foundRuntime + logrus.Debugf("using runtime %q from $PATH: %q", name, foundRuntime) + } + } + if !foundPath { return nil, errors.Wrapf(define.ErrInvalidArg, "no valid executable found for OCI runtime %s", name) } |