mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Allow containerd shim refs in default-runtime
Since runtimes can now just be containerd shims, we need to check if the reference is possibly a containerd shim. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -45,15 +45,16 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
|
||||
v.ContainerdCommit.ID = "N/A"
|
||||
v.InitCommit.ID = "N/A"
|
||||
|
||||
defaultRuntimeBinary := daemon.configStore.GetRuntime(v.DefaultRuntime).Path
|
||||
if rv, err := exec.Command(defaultRuntimeBinary, "--version").Output(); err == nil {
|
||||
if _, _, commit, err := parseRuntimeVersion(string(rv)); err != nil {
|
||||
logrus.Warnf("failed to parse %s version: %v", defaultRuntimeBinary, err)
|
||||
if rt := daemon.configStore.GetRuntime(v.DefaultRuntime); rt != nil {
|
||||
if rv, err := exec.Command(rt.Path, "--version").Output(); err == nil {
|
||||
if _, _, commit, err := parseRuntimeVersion(string(rv)); err != nil {
|
||||
logrus.Warnf("failed to parse %s version: %v", rt.Path, err)
|
||||
} else {
|
||||
v.RuncCommit.ID = commit
|
||||
}
|
||||
} else {
|
||||
v.RuncCommit.ID = commit
|
||||
logrus.Warnf("failed to retrieve %s version: %v", rt.Path, err)
|
||||
}
|
||||
} else {
|
||||
logrus.Warnf("failed to retrieve %s version: %v", defaultRuntimeBinary, err)
|
||||
}
|
||||
|
||||
if rv, err := daemon.containerd.Version(context.Background()); err == nil {
|
||||
@@ -176,21 +177,22 @@ func (daemon *Daemon) fillPlatformVersion(v *types.Version) {
|
||||
}
|
||||
|
||||
defaultRuntime := daemon.configStore.GetDefaultRuntimeName()
|
||||
defaultRuntimeBinary := daemon.configStore.GetRuntime(defaultRuntime).Path
|
||||
if rv, err := exec.Command(defaultRuntimeBinary, "--version").Output(); err == nil {
|
||||
if _, ver, commit, err := parseRuntimeVersion(string(rv)); err != nil {
|
||||
logrus.Warnf("failed to parse %s version: %v", defaultRuntimeBinary, err)
|
||||
if rt := daemon.configStore.GetRuntime(defaultRuntime); rt != nil {
|
||||
if rv, err := exec.Command(rt.Path, "--version").Output(); err == nil {
|
||||
if _, ver, commit, err := parseRuntimeVersion(string(rv)); err != nil {
|
||||
logrus.Warnf("failed to parse %s version: %v", rt.Path, err)
|
||||
} else {
|
||||
v.Components = append(v.Components, types.ComponentVersion{
|
||||
Name: defaultRuntime,
|
||||
Version: ver,
|
||||
Details: map[string]string{
|
||||
"GitCommit": commit,
|
||||
},
|
||||
})
|
||||
}
|
||||
} else {
|
||||
v.Components = append(v.Components, types.ComponentVersion{
|
||||
Name: defaultRuntime,
|
||||
Version: ver,
|
||||
Details: map[string]string{
|
||||
"GitCommit": commit,
|
||||
},
|
||||
})
|
||||
logrus.Warnf("failed to retrieve %s version: %v", rt.Path, err)
|
||||
}
|
||||
} else {
|
||||
logrus.Warnf("failed to retrieve %s version: %v", defaultRuntimeBinary, err)
|
||||
}
|
||||
|
||||
defaultInitBinary := daemon.configStore.GetInitPath()
|
||||
|
||||
Reference in New Issue
Block a user