diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 944ef21c..18435b75 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,6 +1,6 @@ { "ImportPath": "github.com/rancherio/os", - "GoVersion": "go1.4.1", + "GoVersion": "go1.4.2", "Deps": [ { "ImportPath": "github.com/Sirupsen/logrus", @@ -142,7 +142,7 @@ }, { "ImportPath": "github.com/docker/machine/utils", - "Comment": "v0.1.0-rc3-18-gd674e87", + "Comment": "v0.1.0-rc4", "Rev": "d674e87813ffc10048f55d884396be1af327705e" }, { @@ -172,13 +172,13 @@ }, { "ImportPath": "github.com/rancherio/rancher-compose/librcompose/docker", - "Comment": "0.1.0-25-g22c2b87", - "Rev": "22c2b870151ab3fa7f3727cfc4504e326ea512e1" + "Comment": "0.1.0-27-g1be3efa", + "Rev": "1be3efa22d0bbae71d1aed14fcdb870dd0706f1c" }, { "ImportPath": "github.com/rancherio/rancher-compose/librcompose/project", - "Comment": "0.1.0-25-g22c2b87", - "Rev": "22c2b870151ab3fa7f3727cfc4504e326ea512e1" + "Comment": "0.1.0-27-g1be3efa", + "Rev": "1be3efa22d0bbae71d1aed14fcdb870dd0706f1c" }, { "ImportPath": "github.com/ryanuber/go-glob", diff --git a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/librcompose/docker/convert.go b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/librcompose/docker/convert.go index f8f36689..b1f22e75 100644 --- a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/librcompose/docker/convert.go +++ b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/librcompose/docker/convert.go @@ -10,10 +10,30 @@ import ( shlex "github.com/flynn/go-shlex" ) +func Filter(vs []string, f func(string) bool) []string { + r := make([]string, 0, len(vs)) + for _, v := range vs { + if f(v) { + r = append(r, v) + } + } + return r +} + +func isBind(s string) bool { + return strings.ContainsRune(s, ':') +} + +func isVolume(s string) bool { + return !isBind(s) +} + func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig, error) { - volumes := map[string]struct{}{} - for _, v := range c.Volumes { - volumes[strings.Split(v, ":")[0]] = struct{}{} + vs := Filter(c.Volumes, isVolume) + + volumes := make(map[string]struct {}, len(vs)) + for _, v := range vs { + volumes[v] = struct {}{} } cmd, _ := shlex.Split(c.Command) @@ -51,6 +71,7 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig Tty: c.Tty, OpenStdin: c.StdinOpen, WorkingDir: c.WorkingDir, + Volumes: volumes, } host_config := &runconfig.HostConfig{ VolumesFrom: c.VolumesFrom, @@ -58,10 +79,10 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig CapDrop: c.CapDrop, CpuShares: c.CpuShares, Privileged: c.Privileged, - Binds: c.Volumes, + Binds: Filter(c.Volumes, isBind), Dns: dns, DnsSearch: dnssearch, - LogConfig: runconfig.LogConfig{ + LogConfig: runconfig.LogConfig{ Type: c.LogDriver, }, Memory: c.MemLimit,