Add suffix to experimental builds version

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie 2015-05-21 10:48:36 -07:00
parent ef0a145593
commit 78578125ce
6 changed files with 41 additions and 8 deletions

View File

@ -87,7 +87,10 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, " %s\n", attribute)
}
}
fmt.Fprintf(cli.out, "Experimental: %t\n", info.ExperimentalBuild)
if info.ExperimentalBuild {
fmt.Fprintf(cli.out, "Experimental: true\n")
}
return nil
}

View File

@ -22,6 +22,7 @@ import (
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/pkg/timeutils"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
const CanDaemon = true
@ -80,6 +81,10 @@ func migrateKey() (err error) {
}
func mainDaemon() {
if utils.ExperimentalBuild() {
logrus.Warn("Running experimental build")
}
if flag.NArg() != 0 {
flag.Usage()
return

View File

@ -16,7 +16,6 @@ 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 (
@ -60,10 +59,6 @@ func main() {
setLogLevel(logrus.DebugLevel)
}
if utils.ExperimentalBuild() {
logrus.Warn("Running experimental build")
}
if len(flHosts) == 0 {
defaultHost := os.Getenv("DOCKER_HOST")
if defaultHost == "" || *flDaemon {

View File

@ -96,6 +96,7 @@ fi
if [ "$DOCKER_EXPERIMENTAL" ]; then
echo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'
echo >&2
VERSION+="-experimental"
DOCKER_BUILDTAGS+=" experimental"
fi

View File

@ -0,0 +1,24 @@
// +build experimental
package main
import (
"os/exec"
"strings"
"github.com/go-check/check"
)
func (s *DockerSuite) TestExperimentalVersion(c *check.C) {
versionCmd := exec.Command(dockerBinary, "version")
out, _, err := runCommandWithOutput(versionCmd)
if err != nil {
c.Fatalf("failed to execute docker version: %s, %v", out, err)
}
for _, line := range strings.Split(out, "\n") {
if strings.HasPrefix(line, "Client version:") || strings.HasPrefix(line, "Server version:") {
c.Assert(line, check.Matches, "*-experimental")
}
}
}

View File

@ -4,6 +4,7 @@ import (
"os/exec"
"strings"
"github.com/docker/docker/utils"
"github.com/go-check/check"
)
@ -26,12 +27,16 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
"CPUs:",
"Total Memory:",
"Kernel Version:",
"Storage Driver:"}
"Storage Driver:",
}
if utils.ExperimentalBuild() {
stringsToCheck = append(stringsToCheck, "Experimental: true")
}
for _, linePrefix := range stringsToCheck {
if !strings.Contains(out, linePrefix) {
c.Errorf("couldn't find string %v in output", linePrefix)
}
}
}