summaryrefslogtreecommitdiff
path: root/daemon/daemon.go
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2023-02-17 14:12:06 -0500
committerCory Snider <csnider@mirantis.com>2023-02-17 18:08:06 -0500
commitb0eed5ade62404ea70cad9fd86bc1a713e394acd (patch)
tree8dc2426a41154074479a109d56741bdf10dcdf3e /daemon/daemon.go
parentc030f7f40d62ecabfedd1cf96fbb734ce051ce73 (diff)
downloaddocker-b0eed5ade62404ea70cad9fd86bc1a713e394acd.tar.gz
daemon: allow shimv2 runtimes to be configured
Kubernetes only permits RuntimeClass values which are valid lowercase RFC 1123 labels, which disallows the period character. This prevents cri-dockerd from being able to support configuring alternative shimv2 runtimes for a pod as shimv2 runtime names must contain at least one period character. Add support for configuring named shimv2 runtimes in daemon.json so that runtime names can be aliased to Kubernetes-compatible names. Allow options to be set on shimv2 runtimes in daemon.json. The names of the new daemon runtime config fields have been selected to correspond with the equivalent field names in cri-containerd's configuration so that users can more easily follow documentation from the runtime vendor written for cri-containerd and apply it to daemon.json. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'daemon/daemon.go')
-rw-r--r--daemon/daemon.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go
index eecdd85f33..572bcfb817 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -908,15 +908,17 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
}
}
- var rt types.Runtime
+ var (
+ shim string
+ shimOpts interface{}
+ )
if runtime.GOOS != "windows" {
- rtPtr, err := d.getRuntime(config.GetDefaultRuntimeName())
+ shim, shimOpts, err = d.getRuntime(config.GetDefaultRuntimeName())
if err != nil {
return nil, err
}
- rt = *rtPtr
}
- return pluginexec.New(ctx, getPluginExecRoot(config), pluginCli, config.ContainerdPluginNamespace, m, rt)
+ return pluginexec.New(ctx, getPluginExecRoot(config), pluginCli, config.ContainerdPluginNamespace, m, shim, shimOpts)
}
// Plugin system initialization should happen before restore. Do not change order.