Merge pull request #13731 from jfrazelle/fix-version-on-old-versions

fix version struct on old versions
This commit is contained in:
Arnaud Porterie 2015-06-03 17:24:53 -07:00
commit f37e6e180f
2 changed files with 12 additions and 8 deletions

View File

@ -246,14 +246,18 @@ func (s *Server) postAuth(version version.Version, w http.ResponseWriter, r *htt
func (s *Server) getVersion(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v := &types.Version{
Version: dockerversion.VERSION,
ApiVersion: api.APIVERSION,
GitCommit: dockerversion.GITCOMMIT,
GoVersion: runtime.Version(),
Os: runtime.GOOS,
Arch: runtime.GOARCH,
Experimental: utils.ExperimentalBuild(),
Version: dockerversion.VERSION,
ApiVersion: api.APIVERSION,
GitCommit: dockerversion.GITCOMMIT,
GoVersion: runtime.Version(),
Os: runtime.GOOS,
Arch: runtime.GOARCH,
}
if version.GreaterThanOrEqualTo("1.19") {
v.Experimental = utils.ExperimentalBuild()
}
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
v.KernelVersion = kernelVersion.String()
}

View File

@ -132,7 +132,7 @@ type Version struct {
Os string
Arch string
KernelVersion string `json:",omitempty"`
Experimental bool
Experimental bool `json:",omitempty"`
}
// GET "/info"