mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #13731 from jfrazelle/fix-version-on-old-versions
fix version struct on old versions
This commit is contained in:
commit
f37e6e180f
2 changed files with 12 additions and 8 deletions
|
@ -252,8 +252,12 @@ func (s *Server) getVersion(version version.Version, w http.ResponseWriter, r *h
|
||||||
GoVersion: runtime.Version(),
|
GoVersion: runtime.Version(),
|
||||||
Os: runtime.GOOS,
|
Os: runtime.GOOS,
|
||||||
Arch: runtime.GOARCH,
|
Arch: runtime.GOARCH,
|
||||||
Experimental: utils.ExperimentalBuild(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if version.GreaterThanOrEqualTo("1.19") {
|
||||||
|
v.Experimental = utils.ExperimentalBuild()
|
||||||
|
}
|
||||||
|
|
||||||
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
|
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
|
||||||
v.KernelVersion = kernelVersion.String()
|
v.KernelVersion = kernelVersion.String()
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ type Version struct {
|
||||||
Os string
|
Os string
|
||||||
Arch string
|
Arch string
|
||||||
KernelVersion string `json:",omitempty"`
|
KernelVersion string `json:",omitempty"`
|
||||||
Experimental bool
|
Experimental bool `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET "/info"
|
// GET "/info"
|
||||||
|
|
Loading…
Add table
Reference in a new issue