From fa0e48f21aaf0bc186312b64719a3e7df39fb990 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 19 Jun 2019 17:12:27 -0400 Subject: 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 --- libpod/runtime.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libpod/runtime.go b/libpod/runtime.go index caeabbe9a..56ad1ffe8 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -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 -- cgit v1.2.3-54-g00ecf