Merge pull request #1760 from josmo/add-container-labels

Adding the ability to label containers launched by drone
This commit is contained in:
Brad Rydzewski 2016-09-01 10:39:04 -05:00 committed by GitHub
commit 31a0fd0eed
2 changed files with 4 additions and 0 deletions

View file

@ -14,6 +14,7 @@ func toContainerConfig(c *yaml.Container) *dockerclient.ContainerConfig {
config := &dockerclient.ContainerConfig{ config := &dockerclient.ContainerConfig{
Image: c.Image, Image: c.Image,
Env: toEnvironmentSlice(c.Environment), Env: toEnvironmentSlice(c.Environment),
Labels: c.Labels,
Cmd: c.Command, Cmd: c.Command,
Entrypoint: c.Entrypoint, Entrypoint: c.Entrypoint,
WorkingDir: c.WorkingDir, WorkingDir: c.WorkingDir,

View file

@ -27,6 +27,7 @@ type Container struct {
Privileged bool Privileged bool
WorkingDir string WorkingDir string
Environment map[string]string Environment map[string]string
Labels map[string]string
Entrypoint []string Entrypoint []string
Command []string Command []string
Commands []string Commands []string
@ -61,6 +62,7 @@ type container struct {
Pull bool `yaml:"pull"` Pull bool `yaml:"pull"`
Privileged bool `yaml:"privileged"` Privileged bool `yaml:"privileged"`
Environment types.MapEqualSlice `yaml:"environment"` Environment types.MapEqualSlice `yaml:"environment"`
Labels types.MapEqualSlice `yaml:"labels"`
Entrypoint types.StringOrSlice `yaml:"entrypoint"` Entrypoint types.StringOrSlice `yaml:"entrypoint"`
Command types.StringOrSlice `yaml:"command"` Command types.StringOrSlice `yaml:"command"`
Commands types.StringOrSlice `yaml:"commands"` Commands types.StringOrSlice `yaml:"commands"`
@ -129,6 +131,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
Pull: cc.Pull, Pull: cc.Pull,
Privileged: cc.Privileged, Privileged: cc.Privileged,
Environment: cc.Environment.Map(), Environment: cc.Environment.Map(),
Labels: cc.Labels.Map(),
Entrypoint: cc.Entrypoint.Slice(), Entrypoint: cc.Entrypoint.Slice(),
Command: cc.Command.Slice(), Command: cc.Command.Slice(),
Commands: cc.Commands.Slice(), Commands: cc.Commands.Slice(),