mirror of
https://github.com/docker/cli.git
synced 2026-01-26 15:41:42 +03:00
Merge pull request #35705 from tiborvass/platform-version
api: generalize version information to any platform component Upstream-commit: a1be987ea9e03e5ebdb1b415a7acdd8d6f0aaa08 Component: engine
This commit is contained in:
@@ -154,24 +154,46 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
||||
|
||||
// SystemVersion returns version information about the daemon.
|
||||
func (daemon *Daemon) SystemVersion() types.Version {
|
||||
v := types.Version{
|
||||
Version: dockerversion.Version,
|
||||
GitCommit: dockerversion.GitCommit,
|
||||
MinAPIVersion: api.MinVersion,
|
||||
GoVersion: runtime.Version(),
|
||||
Os: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
BuildTime: dockerversion.BuildTime,
|
||||
Experimental: daemon.configStore.Experimental,
|
||||
}
|
||||
|
||||
kernelVersion := "<unknown>"
|
||||
if kv, err := kernel.GetKernelVersion(); err != nil {
|
||||
logrus.Warnf("Could not get kernel version: %v", err)
|
||||
} else {
|
||||
kernelVersion = kv.String()
|
||||
}
|
||||
v.KernelVersion = kernelVersion
|
||||
|
||||
v := types.Version{
|
||||
Components: []types.ComponentVersion{
|
||||
{
|
||||
Name: "Engine",
|
||||
Version: dockerversion.Version,
|
||||
Details: map[string]string{
|
||||
"GitCommit": dockerversion.GitCommit,
|
||||
"ApiVersion": api.DefaultVersion,
|
||||
"MinAPIVersion": api.MinVersion,
|
||||
"GoVersion": runtime.Version(),
|
||||
"Os": runtime.GOOS,
|
||||
"Arch": runtime.GOARCH,
|
||||
"BuildTime": dockerversion.BuildTime,
|
||||
"KernelVersion": kernelVersion,
|
||||
"Experimental": fmt.Sprintf("%t", daemon.configStore.Experimental),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// Populate deprecated fields for older clients
|
||||
Version: dockerversion.Version,
|
||||
GitCommit: dockerversion.GitCommit,
|
||||
APIVersion: api.DefaultVersion,
|
||||
MinAPIVersion: api.MinVersion,
|
||||
GoVersion: runtime.Version(),
|
||||
Os: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
BuildTime: dockerversion.BuildTime,
|
||||
KernelVersion: kernelVersion,
|
||||
Experimental: daemon.configStore.Experimental,
|
||||
}
|
||||
|
||||
v.Platform.Name = dockerversion.PlatformName
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user