From 7bfac4f3495dbc6bc6f9a1f19d3e68c16985e6b3 Mon Sep 17 00:00:00 2001 From: WxNzEMof <143541718+WxNzEMof@users.noreply.github.com> Date: Wed, 8 May 2024 12:30:42 +0000 Subject: [PATCH] Don't panic if a runtime was configured without paths Signed-off-by: WxNzEMof <143541718+WxNzEMof@users.noreply.github.com> --- pkg/api/handlers/compat/info.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go index 1822f57569..d4c2f5f649 100644 --- a/pkg/api/handlers/compat/info.go +++ b/pkg/api/handlers/compat/info.go @@ -192,6 +192,9 @@ func getSecOpts(sysInfo *sysinfo.SysInfo) []string { func getRuntimes(configInfo *config.Config) map[string]dockerSystem.RuntimeWithStatus { runtimes := map[string]dockerSystem.RuntimeWithStatus{} for name, paths := range configInfo.Engine.OCIRuntimes { + if len(paths) == 0 { + continue + } runtime := dockerSystem.RuntimeWithStatus{} runtime.Runtime = dockerSystem.Runtime{Path: paths[0], Args: nil} runtimes[name] = runtime