mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix experimental version and release script
add api version experimental Signed-off-by: Jessica Frazelle <princess@docker.com>
This commit is contained in:
parent
87d36079a7
commit
b372f9f224
7 changed files with 30 additions and 12 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/autogen/dockerversion"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/utils"
|
||||
)
|
||||
|
||||
// CmdVersion shows Docker version information.
|
||||
|
@ -31,6 +32,9 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
|
|||
fmt.Fprintf(cli.out, "Git commit (client): %s\n", dockerversion.GITCOMMIT)
|
||||
}
|
||||
fmt.Fprintf(cli.out, "OS/Arch (client): %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||
if utils.ExperimentalBuild() {
|
||||
fmt.Fprintf(cli.out, "Experimental (client): true\n")
|
||||
}
|
||||
|
||||
stream, _, err := cli.call("GET", "/version", nil, nil)
|
||||
if err != nil {
|
||||
|
@ -50,6 +54,8 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
|
|||
fmt.Fprintf(cli.out, "Go version (server): %s\n", v.GoVersion)
|
||||
fmt.Fprintf(cli.out, "Git commit (server): %s\n", v.GitCommit)
|
||||
fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", v.Os, v.Arch)
|
||||
|
||||
if v.Experimental {
|
||||
fmt.Fprintf(cli.out, "Experimental (server): true\n")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -246,12 +246,13 @@ 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,
|
||||
Version: dockerversion.VERSION,
|
||||
ApiVersion: api.APIVERSION,
|
||||
GitCommit: dockerversion.GITCOMMIT,
|
||||
GoVersion: runtime.Version(),
|
||||
Os: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
Experimental: utils.ExperimentalBuild(),
|
||||
}
|
||||
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
|
||||
v.KernelVersion = kernelVersion.String()
|
||||
|
|
|
@ -132,6 +132,7 @@ type Version struct {
|
|||
Os string
|
||||
Arch string
|
||||
KernelVersion string `json:",omitempty"`
|
||||
Experimental bool
|
||||
}
|
||||
|
||||
// GET "/info"
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"github.com/docker/docker/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -161,5 +162,9 @@ func main() {
|
|||
}
|
||||
|
||||
func showVersion() {
|
||||
fmt.Printf("Docker version %s, build %s\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
|
||||
if utils.ExperimentalBuild() {
|
||||
fmt.Printf("Docker version %s, build %s, experimental\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
|
||||
} else {
|
||||
fmt.Printf("Docker version %s, build %s\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1687,7 +1687,8 @@ Show the docker version information
|
|||
"GoVersion": "go1.4.1",
|
||||
"GitCommit": "a8a31ef",
|
||||
"Arch": "amd64",
|
||||
"ApiVersion": "1.19"
|
||||
"ApiVersion": "1.20",
|
||||
"Experimental": false
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
|
|
|
@ -96,7 +96,6 @@ fi
|
|||
if [ "$DOCKER_EXPERIMENTAL" ]; then
|
||||
echo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'
|
||||
echo >&2
|
||||
VERSION+="-experimental"
|
||||
DOCKER_BUILDTAGS+=" experimental"
|
||||
fi
|
||||
|
||||
|
|
|
@ -17,8 +17,13 @@ func (s *DockerSuite) TestExperimentalVersion(c *check.C) {
|
|||
}
|
||||
|
||||
for _, line := range strings.Split(out, "\n") {
|
||||
if strings.HasPrefix(line, "Client version:") || strings.HasPrefix(line, "Server version:") {
|
||||
c.Assert(line, check.Matches, "*-experimental")
|
||||
if strings.HasPrefix(line, "Experimental (client):") || strings.HasPrefix(line, "Experimental (server):") {
|
||||
c.Assert(line, check.Matches, "*true")
|
||||
}
|
||||
}
|
||||
|
||||
versionCmd = exec.Command(dockerBinary, "-v")
|
||||
if out, _, err = runCommandWithOutput(versionCmd); err != nil || !strings.Contains(out, ", experimental") {
|
||||
c.Fatalf("docker version did not contain experimental: %s, %v", out, err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue