Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Arnaud Porterie authored on 2015/05/22 02:48:36... | ... |
@@ -87,7 +87,10 @@ func (cli *DockerCli) CmdInfo(args ...string) error { |
87 | 87 |
fmt.Fprintf(cli.out, " %s\n", attribute) |
88 | 88 |
} |
89 | 89 |
} |
90 |
- fmt.Fprintf(cli.out, "Experimental: %t\n", info.ExperimentalBuild) |
|
90 |
+ |
|
91 |
+ if info.ExperimentalBuild { |
|
92 |
+ fmt.Fprintf(cli.out, "Experimental: true\n") |
|
93 |
+ } |
|
91 | 94 |
|
92 | 95 |
return nil |
93 | 96 |
} |
... | ... |
@@ -22,6 +22,7 @@ import ( |
22 | 22 |
"github.com/docker/docker/pkg/system" |
23 | 23 |
"github.com/docker/docker/pkg/timeutils" |
24 | 24 |
"github.com/docker/docker/registry" |
25 |
+ "github.com/docker/docker/utils" |
|
25 | 26 |
) |
26 | 27 |
|
27 | 28 |
const CanDaemon = true |
... | ... |
@@ -80,6 +81,10 @@ func migrateKey() (err error) { |
80 | 80 |
} |
81 | 81 |
|
82 | 82 |
func mainDaemon() { |
83 |
+ if utils.ExperimentalBuild() { |
|
84 |
+ logrus.Warn("Running experimental build") |
|
85 |
+ } |
|
86 |
+ |
|
83 | 87 |
if flag.NArg() != 0 { |
84 | 88 |
flag.Usage() |
85 | 89 |
return |
... | ... |
@@ -16,7 +16,6 @@ import ( |
16 | 16 |
flag "github.com/docker/docker/pkg/mflag" |
17 | 17 |
"github.com/docker/docker/pkg/reexec" |
18 | 18 |
"github.com/docker/docker/pkg/term" |
19 |
- "github.com/docker/docker/utils" |
|
20 | 19 |
) |
21 | 20 |
|
22 | 21 |
const ( |
... | ... |
@@ -60,10 +59,6 @@ func main() { |
60 | 60 |
setLogLevel(logrus.DebugLevel) |
61 | 61 |
} |
62 | 62 |
|
63 |
- if utils.ExperimentalBuild() { |
|
64 |
- logrus.Warn("Running experimental build") |
|
65 |
- } |
|
66 |
- |
|
67 | 63 |
if len(flHosts) == 0 { |
68 | 64 |
defaultHost := os.Getenv("DOCKER_HOST") |
69 | 65 |
if defaultHost == "" || *flDaemon { |
102 | 103 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,24 @@ |
0 |
+// +build experimental |
|
1 |
+ |
|
2 |
+package main |
|
3 |
+ |
|
4 |
+import ( |
|
5 |
+ "os/exec" |
|
6 |
+ "strings" |
|
7 |
+ |
|
8 |
+ "github.com/go-check/check" |
|
9 |
+) |
|
10 |
+ |
|
11 |
+func (s *DockerSuite) TestExperimentalVersion(c *check.C) { |
|
12 |
+ versionCmd := exec.Command(dockerBinary, "version") |
|
13 |
+ out, _, err := runCommandWithOutput(versionCmd) |
|
14 |
+ if err != nil { |
|
15 |
+ c.Fatalf("failed to execute docker version: %s, %v", out, err) |
|
16 |
+ } |
|
17 |
+ |
|
18 |
+ for _, line := range strings.Split(out, "\n") { |
|
19 |
+ if strings.HasPrefix(line, "Client version:") || strings.HasPrefix(line, "Server version:") { |
|
20 |
+ c.Assert(line, check.Matches, "*-experimental") |
|
21 |
+ } |
|
22 |
+ } |
|
23 |
+} |
... | ... |
@@ -4,6 +4,7 @@ import ( |
4 | 4 |
"os/exec" |
5 | 5 |
"strings" |
6 | 6 |
|
7 |
+ "github.com/docker/docker/utils" |
|
7 | 8 |
"github.com/go-check/check" |
8 | 9 |
) |
9 | 10 |
|
... | ... |
@@ -26,12 +27,16 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) { |
26 | 26 |
"CPUs:", |
27 | 27 |
"Total Memory:", |
28 | 28 |
"Kernel Version:", |
29 |
- "Storage Driver:"} |
|
29 |
+ "Storage Driver:", |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ if utils.ExperimentalBuild() { |
|
33 |
+ stringsToCheck = append(stringsToCheck, "Experimental: true") |
|
34 |
+ } |
|
30 | 35 |
|
31 | 36 |
for _, linePrefix := range stringsToCheck { |
32 | 37 |
if !strings.Contains(out, linePrefix) { |
33 | 38 |
c.Errorf("couldn't find string %v in output", linePrefix) |
34 | 39 |
} |
35 | 40 |
} |
36 |
- |
|
37 | 41 |
} |