Adds minimum API version to version

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-11-02 10:04:39 -07:00 коммит произвёл John Howard (VM)
Родитель 78a83a2269
Коммит d29995bb84
6 изменённых файлов: 22 добавлений и 16 удалений

Просмотреть файл

@ -133,6 +133,7 @@ type ContainerProcessList struct {
type Version struct {
Version string
APIVersion string `json:"ApiVersion"`
MinAPIVersion string `json:"MinAPIVersion,omitempty"`
GitCommit string
GoVersion string
Os string

Просмотреть файл

@ -23,13 +23,14 @@ var versionTemplate = `Client:
OS/Arch: {{.Client.Os}}/{{.Client.Arch}}{{if .ServerOK}}
Server:
Version: {{.Server.Version}}
API version: {{.Server.APIVersion}}
Go version: {{.Server.GoVersion}}
Git commit: {{.Server.GitCommit}}
Built: {{.Server.BuildTime}}
OS/Arch: {{.Server.Os}}/{{.Server.Arch}}
Experimental: {{.Server.Experimental}}{{end}}`
Version: {{.Server.Version}}
API version: {{.Server.APIVersion}}
Minimum API version: {{.Server.MinAPIVersion}}
Go version: {{.Server.GoVersion}}
Git commit: {{.Server.GitCommit}}
Built: {{.Server.BuildTime}}
OS/Arch: {{.Server.Os}}/{{.Server.Arch}}
Experimental: {{.Server.Experimental}}{{end}}`
type versionOptions struct {
format string

Просмотреть файл

@ -7,6 +7,7 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/container"
"github.com/docker/docker/dockerversion"
@ -156,13 +157,14 @@ 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,
GoVersion: runtime.Version(),
Os: runtime.GOOS,
Arch: runtime.GOARCH,
BuildTime: dockerversion.BuildTime,
Experimental: daemon.configStore.Experimental,
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>"

Просмотреть файл

@ -130,6 +130,7 @@ This section lists each version from latest to oldest. Each listing includes a
[Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation
* `GET /version` now returns `MinAPIVersion`.
* `POST /build` accepts `networkmode` parameter to specify network used during build.
* `GET /images/(name)/json` now returns `OsVersion` if populated
* `GET /info` now returns `Isolation`.

Просмотреть файл

@ -2741,6 +2741,7 @@ Show the docker version information
"GitCommit": "deadbee",
"Arch": "amd64",
"ApiVersion": "1.25",
"MinAPIVersion": "1.12",
"BuildTime": "2016-06-14T07:09:13.444803460+00:00",
"Experimental": true
}

Просмотреть файл

@ -14,7 +14,7 @@ func (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) {
"Client:": 1,
"Server:": 1,
" Version:": 2,
" API version:": 2,
" API version:": 3,
" Go version:": 2,
" Git commit:": 2,
" OS/Arch:": 2,
@ -40,7 +40,7 @@ func (s *DockerSuite) TestVersionPlatform_l(c *check.C) {
func testVersionPlatform(c *check.C, platform string) {
out, _ := dockerCmd(c, "version")
expected := "OS/Arch: " + platform
expected := "OS/Arch: " + platform
split := strings.Split(out, "\n")
c.Assert(len(split) >= 14, checker.Equals, true, check.Commentf("got %d lines from version", len(split)))