зеркало из https://github.com/microsoft/docker.git
Merge pull request #13731 from jfrazelle/fix-version-on-old-versions
fix version struct on old versions
This commit is contained in:
Коммит
f37e6e180f
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ type Version struct {
|
|||
Os string
|
||||
Arch string
|
||||
KernelVersion string `json:",omitempty"`
|
||||
Experimental bool
|
||||
Experimental bool `json:",omitempty"`
|
||||
}
|
||||
|
||||
// GET "/info"
|
||||
|
|
Загрузка…
Ссылка в новой задаче