Merge pull request #1876 from bradrydzewski/master

Read detach attribute from yaml
This commit is contained in:
Brad Rydzewski 2016-11-28 09:21:22 +01:00 committed by GitHub
commit 43b11ed322
2 changed files with 4 additions and 0 deletions

View file

@ -61,6 +61,7 @@ type container struct {
Image string `yaml:"image"`
Build string `yaml:"build"`
Pull bool `yaml:"pull"`
Detached bool `yaml:"detach"`
Privileged bool `yaml:"privileged"`
Environment types.MapEqualSlice `yaml:"environment"`
Labels types.MapEqualSlice `yaml:"labels"`
@ -131,6 +132,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
Image: cc.Image,
Build: cc.Build,
Pull: cc.Pull,
Detached: cc.Detached,
Privileged: cc.Privileged,
Environment: cc.Environment.Map(),
Labels: cc.Labels.Map(),

View file

@ -27,6 +27,7 @@ func TestContainerNode(t *testing.T) {
g.Assert(c.Image).Equal("golang")
g.Assert(c.Build).Equal(".")
g.Assert(c.Pull).Equal(true)
g.Assert(c.Detached).Equal(true)
g.Assert(c.Privileged).Equal(true)
g.Assert(c.Entrypoint).Equal([]string{"/bin/sh"})
g.Assert(c.Command).Equal([]string{"yes"})
@ -69,6 +70,7 @@ foo:
image: golang
build: .
pull: true
detach: true
privileged: true
environment:
FOO: BAR