fix version struct on old versions

Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 229b599259)
This commit is contained in:
Jessica Frazelle
2015-06-03 17:33:10 -07:00
parent 339f0a128a
commit 18af7fdbba
2 changed files with 12 additions and 8 deletions
+11 -7
View File
@@ -247,14 +247,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()
}
+1 -1
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"