Permalink
Browse files

Mark --volume-driver as experimental

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
  • Loading branch information...
Arnaud Porterie authored and calavera committed May 20, 2015
1 parent 7da5a7e commit 4fc37a1ede58153bfa6aa5c9aa0f2903f18d572f
@@ -142,6 +142,7 @@ Create a container
"ExposedPorts": {
"22/tcp": {}
},
VolumeDriver: "local",
"HostConfig": {
"Binds": ["/tmp:/tmp"],
"Links": ["redis3:redis"],
@@ -222,15 +223,15 @@ Json Parameters:
container
- **ExposedPorts** - An object mapping ports to an empty object in the form of:
`"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
- **VolumeDriver** - A string value containing the volume driver to use, `local` by default.
- **HostConfig**
- **Binds** – A list of volume bindings for this container. Each volume
binding is a string of the form `container_path` (to create a new
volume for the container), `host_path:container_path` (to bind-mount
a host path into the container), `host_path:container_path:ro`
(to make the bind-mount read-only inside the container), or
`volume_plugin/volume_name:container_path` (to provision a
volume named `volume_name` from a [volume plugin](/userguide/plugins)
named `volume_plugin`).
`volume_name:container_path` (to provision a volume named `volume_name`
from a [volume plugin](/userguide/plugins)).
- **Links** - A list of links for the container. Each link entry should be
in the form of `container_name:alias`.
- **LxcConf** - LXC specific configurations. These configurations will only
@@ -1,3 +1,4 @@
// +build experimental
// +build !windows
package main
@@ -136,15 +137,3 @@ func (s *ExternalVolumeSuite) TestStartExternalVolumeDriver(c *check.C) {
c.Fatalf("External volume mount failed. Output: %s\n", out)
}
}
func (s *ExternalVolumeSuite) TestStartExternalVolumeNamedDriver(c *check.C) {
runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "-v", "test-external-volume-driver/volume-1:/tmp/external-volume-test", "busybox:latest", "cat", "/tmp/external-volume-test/test")
out, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)
if err != nil && exitCode != 0 {
c.Fatal(out, stderr, err)
}
if !strings.Contains(out, s.server.URL) {
c.Fatalf("External volume mount failed. Output: %s\n", out)
}
}
View
@@ -77,7 +77,6 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
flReadonlyRootfs = cmd.Bool([]string{"-read-only"}, false, "Mount the container's root filesystem as read only")
flLoggingDriver = cmd.String([]string{"-log-driver"}, "", "Logging driver for container")
flCgroupParent = cmd.String([]string{"-cgroup-parent"}, "", "Optional parent cgroup for the container")
flVolumeDriver = cmd.String([]string{"-volume-driver"}, "", "Optional volume driver for the container")
)
cmd.Var(&flAttach, []string{"a", "-attach"}, "Attach to STDIN, STDOUT or STDERR")
@@ -101,6 +100,8 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
cmd.Var(flUlimits, []string{"-ulimit"}, "Ulimit options")
cmd.Var(&flLoggingOpts, []string{"-log-opt"}, "Log driver options")
expFlags := attachExperimentalFlags(cmd)
cmd.Require(flag.Min, 1)
if err := cmd.ParseFlags(args, true); err != nil {
@@ -318,7 +319,6 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
Entrypoint: entrypoint,
WorkingDir: *flWorkingDir,
Labels: convertKVStringsToMap(labels),
VolumeDriver: *flVolumeDriver,
}
hostConfig := &HostConfig{
@@ -357,6 +357,8 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
CgroupParent: *flCgroupParent,
}
applyExperimentalFlags(expFlags, config, hostConfig)
// When allocating stdin in attached mode, close stdin at client disconnect
if config.OpenStdin && config.AttachStdin {
config.StdinOnce = true
@@ -0,0 +1,19 @@
// +build experimental
package runconfig
import flag "github.com/docker/docker/pkg/mflag"
type experimentalFlags struct {
flags map[string]interface{}
}
func attachExperimentalFlags(cmd *flag.FlagSet) *experimentalFlags {
flags := make(map[string]interface{})
flags["volume-driver"] = cmd.String([]string{"-volume-driver"}, "", "Optional volume driver for the container")
return &experimentalFlags{flags: flags}
}
func applyExperimentalFlags(exp *experimentalFlags, config *Config, hostConfig *HostConfig) {
config.VolumeDriver = *(exp.flags["volume-driver"]).(*string)
}
View
@@ -0,0 +1,14 @@
// +build !experimental
package runconfig
import flag "github.com/docker/docker/pkg/mflag"
type experimentalFlags struct{}
func attachExperimentalFlags(cmd *flag.FlagSet) *experimentalFlags {
return nil
}
func applyExperimentalFlags(flags *experimentalFlags, config *Config, hostConfig *HostConfig) {
}

0 comments on commit 4fc37a1

Please sign in to comment.