mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #13386 from icecrime/experimental_suffix_version
Suffix experimental version / fix warning output
This commit is contained in:
commit
2b8271399e
6 changed files with 41 additions and 8 deletions
|
@ -87,7 +87,10 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
|
||||||
fmt.Fprintf(cli.out, " %s\n", attribute)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import (
|
||||||
"github.com/docker/docker/pkg/system"
|
"github.com/docker/docker/pkg/system"
|
||||||
"github.com/docker/docker/pkg/timeutils"
|
"github.com/docker/docker/pkg/timeutils"
|
||||||
"github.com/docker/docker/registry"
|
"github.com/docker/docker/registry"
|
||||||
|
"github.com/docker/docker/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CanDaemon = true
|
const CanDaemon = true
|
||||||
|
@ -80,6 +81,10 @@ func migrateKey() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func mainDaemon() {
|
func mainDaemon() {
|
||||||
|
if utils.ExperimentalBuild() {
|
||||||
|
logrus.Warn("Running experimental build")
|
||||||
|
}
|
||||||
|
|
||||||
if flag.NArg() != 0 {
|
if flag.NArg() != 0 {
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
return
|
return
|
||||||
|
|
|
@ -16,7 +16,6 @@ import (
|
||||||
flag "github.com/docker/docker/pkg/mflag"
|
flag "github.com/docker/docker/pkg/mflag"
|
||||||
"github.com/docker/docker/pkg/reexec"
|
"github.com/docker/docker/pkg/reexec"
|
||||||
"github.com/docker/docker/pkg/term"
|
"github.com/docker/docker/pkg/term"
|
||||||
"github.com/docker/docker/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -60,10 +59,6 @@ func main() {
|
||||||
setLogLevel(logrus.DebugLevel)
|
setLogLevel(logrus.DebugLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.ExperimentalBuild() {
|
|
||||||
logrus.Warn("Running experimental build")
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(flHosts) == 0 {
|
if len(flHosts) == 0 {
|
||||||
defaultHost := os.Getenv("DOCKER_HOST")
|
defaultHost := os.Getenv("DOCKER_HOST")
|
||||||
if defaultHost == "" || *flDaemon {
|
if defaultHost == "" || *flDaemon {
|
||||||
|
|
|
@ -96,6 +96,7 @@ fi
|
||||||
if [ "$DOCKER_EXPERIMENTAL" ]; then
|
if [ "$DOCKER_EXPERIMENTAL" ]; then
|
||||||
echo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'
|
echo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'
|
||||||
echo >&2
|
echo >&2
|
||||||
|
VERSION+="-experimental"
|
||||||
DOCKER_BUILDTAGS+=" experimental"
|
DOCKER_BUILDTAGS+=" experimental"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
24
integration-cli/docker_cli_experimental_test.go
Normal file
24
integration-cli/docker_cli_experimental_test.go
Normal 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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/docker/docker/utils"
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -26,12 +27,16 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
||||||
"CPUs:",
|
"CPUs:",
|
||||||
"Total Memory:",
|
"Total Memory:",
|
||||||
"Kernel Version:",
|
"Kernel Version:",
|
||||||
"Storage Driver:"}
|
"Storage Driver:",
|
||||||
|
}
|
||||||
|
|
||||||
|
if utils.ExperimentalBuild() {
|
||||||
|
stringsToCheck = append(stringsToCheck, "Experimental: true")
|
||||||
|
}
|
||||||
|
|
||||||
for _, linePrefix := range stringsToCheck {
|
for _, linePrefix := range stringsToCheck {
|
||||||
if !strings.Contains(out, linePrefix) {
|
if !strings.Contains(out, linePrefix) {
|
||||||
c.Errorf("couldn't find string %v in output", linePrefix)
|
c.Errorf("couldn't find string %v in output", linePrefix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue