diff --git a/util/types.go b/util/types.go index dc5f4b6c8e7..49f4989cae1 100644 --- a/util/types.go +++ b/util/types.go @@ -1,8 +1,9 @@ package util const ( - // DefaultRuntime is the default command to use to run the container. - DefaultRuntime = "runc" + // DefaultRuntime should no longer be used. + // Default runtime should come from containers.conf + DefaultRuntime = "crun" // DefaultCNIPluginPath is the default location of CNI plugin helpers. DefaultCNIPluginPath = "/usr/libexec/cni:/opt/cni/bin" // DefaultCNIConfigDir is the default location of CNI configuration files. diff --git a/util/util.go b/util/util.go index 99f68d9e1ce..8133e65238e 100644 --- a/util/util.go +++ b/util/util.go @@ -263,7 +263,12 @@ func Runtime() string { return "crun" } - return DefaultRuntime + conf, err := config.Default() + if err != nil { + logrus.Debugf("Error loading container config when searching for local runtime.") + return "DefaultRuntime" + } + return conf.Engine.OCIRuntime } // StringInSlice returns a boolean indicating if the exact value s is present