diff --git a/api/client/info.go b/api/client/info.go index 918b6bbe7a..9984f23020 100644 --- a/api/client/info.go +++ b/api/client/info.go @@ -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 } diff --git a/docker/daemon.go b/docker/daemon.go index 06bdbc0fc6..fc08bc9c26 100644 --- a/docker/daemon.go +++ b/docker/daemon.go @@ -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 diff --git a/docker/docker.go b/docker/docker.go index 84457b177d..fd40f4b422 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -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 { diff --git a/hack/make.sh b/hack/make.sh index e43f360e82..0ccbdabbe7 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -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 diff --git a/integration-cli/docker_cli_experimental_test.go b/integration-cli/docker_cli_experimental_test.go new file mode 100644 index 0000000000..4cf05c91f9 --- /dev/null +++ b/integration-cli/docker_cli_experimental_test.go @@ -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") + } + } +} diff --git a/integration-cli/docker_cli_info_test.go b/integration-cli/docker_cli_info_test.go index a7a931e852..cf7738d14f 100644 --- a/integration-cli/docker_cli_info_test.go +++ b/integration-cli/docker_cli_info_test.go @@ -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) } } - }