Make a missing OCI runtime nonfatal

We may want to ship configurations including more than one
runtime configuration - for example, crun and runc and kata, all
configured. However, we don't want to make these extra runtimes
hard requirements, so let's not fatally error when we can't find
their executables.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon 2019-06-19 17:12:27 -04:00
parent 92bae8d308
commit fa0e48f21a
1 changed files with 6 additions and 1 deletions

View File

@ -826,7 +826,12 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) {
ociRuntime, err := newOCIRuntime(name, paths, runtime.conmonPath, runtime.config, supportsJSON)
if err != nil {
return err
// Don't fatally error.
// This will allow us to ship configs including optional
// runtimes that might not be installed (crun, kata).
// Only a warnf so default configs don't spec errors.
logrus.Warnf("Error initializing configured OCI runtime %s: %v", name, err)
continue
}
runtime.ociRuntimes[name] = ociRuntime