1
0
mirror of https://github.com/rancher/os.git synced 2025-08-09 10:38:25 +00:00

Godeps rancher-compose bump

This commit is contained in:
Darren Shepherd 2015-05-05 14:04:42 -07:00
parent 4201133193
commit 245a7dd46a
3 changed files with 55 additions and 42 deletions

8
Godeps/Godeps.json generated
View File

@ -172,13 +172,13 @@
},
{
"ImportPath": "github.com/rancherio/rancher-compose/librcompose/docker",
"Comment": "0.1.0-18-g14fef17",
"Rev": "14fef170029bba5896269a3b592035b70ae3f2dc"
"Comment": "0.1.0-22-gb05516d",
"Rev": "b05516d2ddc60579cf34ff89d4214bf3e6421e45"
},
{
"ImportPath": "github.com/rancherio/rancher-compose/librcompose/project",
"Comment": "0.1.0-18-g14fef17",
"Rev": "14fef170029bba5896269a3b592035b70ae3f2dc"
"Comment": "0.1.0-22-gb05516d",
"Rev": "b05516d2ddc60579cf34ff89d4214bf3e6421e45"
},
{
"ImportPath": "github.com/ryanuber/go-glob",

View File

@ -19,13 +19,24 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig
cmd, _ := shlex.Split(c.Command)
entrypoint, _ := shlex.Split(c.Entrypoint)
ports, binding, err := nat.ParsePortSpecs(c.Ports)
restart, err := runconfig.ParseRestartPolicy(c.Restart)
dns := c.Dns.Slice()
labels := c.Labels.MapParts()
if err != nil {
return nil, nil, err
}
restart, err := runconfig.ParseRestartPolicy(c.Restart)
if err != nil {
return nil, nil, err
}
dns := c.Dns.Slice()
dnssearch := c.DnsSearch.Slice()
labels := c.Labels.MapParts()
if len(c.Expose) > 0 {
exposedPorts, _, err := nat.ParsePortSpecs(c.Expose)
ports = exposedPorts
if err != nil {
return nil, nil, err
}
}
config := &runconfig.Config{
Entrypoint: runconfig.NewEntrypoint(entrypoint...),
@ -49,6 +60,7 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig
Privileged: c.Privileged,
Binds: c.Volumes,
Dns: dns,
DnsSearch: dnssearch,
LogConfig: runconfig.LogConfig{
Type: c.LogDriver,
},

View File

@ -34,7 +34,8 @@ func (s *Stringorslice) MarshalYAML() (interface{}, error) {
if s == nil {
return nil, nil
}
return yaml.Marshal(s.Slice())
bytes, err := yaml.Marshal(s.Slice())
return string(bytes), err
}
func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error {
@ -81,7 +82,8 @@ func (s *SliceorMap) MarshalYAML() (interface{}, error) {
if s == nil {
return nil, nil
}
return yaml.Marshal(s.MapParts())
bytes, err := yaml.Marshal(s.MapParts())
return string(bytes), err
}
func (s *SliceorMap) UnmarshalYAML(unmarshal func(interface{}) error) error {
@ -129,16 +131,15 @@ type ServiceConfig struct {
CpuShares int64 `yaml:"cpu_shares,omitempty"`
Command string `yaml:"command,omitempty"`
Detach string `yaml:"detach,omitempty"`
Dns *Stringorslice
DnsSearch string `yaml:"dns_search,omitempty"`
Dns *Stringorslice `yaml:"dns,omitempty"`
DnsSearch *Stringorslice `yaml:"dns_search,omitempty"`
DomainName string `yaml:"domainname,omitempty"`
Entrypoint string `yaml:"entrypoint,omitempty"`
EnvFile string `yaml:"env_file,omitempty"`
Environment []string `yaml:"environment,omitempty"`
Hostname string `yaml:"hostname,omitempty"`
Image string `yaml:"image,omitempty"`
//Labels map[string]string `yaml:"labels,omitempty"`
Labels *SliceorMap
Labels *SliceorMap `yaml:"labels,omitempty"`
Links []string `yaml:"links,omitempty"`
LogDriver string `yaml:"log_driver,omitempty"`
MemLimit int64 `yaml:"mem_limit,omitempty"`