fixes issues running services in detached mode

This commit is contained in:
Brad Rydzewski 2016-11-25 10:32:12 +01:00
parent 5c1fcb082e
commit 58682aa6a7
2 changed files with 12 additions and 0 deletions

View file

@ -40,6 +40,15 @@ func ImageEscalate(conf *yaml.Config, patterns []string) error {
for _, c := range conf.Pipeline { for _, c := range conf.Pipeline {
for _, pattern := range patterns { for _, pattern := range patterns {
if ok, _ := filepath.Match(pattern, c.Image); ok { if ok, _ := filepath.Match(pattern, c.Image); ok {
if c.Detached {
return fmt.Errorf("Detached mode disabled for the %s plugin", c.Image)
}
if len(c.Entrypoint) != 0 {
return fmt.Errorf("Custom entrypoint disabled for the %s plugin", c.Image)
}
if len(c.Command) != 0 {
return fmt.Errorf("Custom command disabled for the %s plugin", c.Image)
}
if len(c.Commands) != 0 { if len(c.Commands) != 0 {
return fmt.Errorf("Custom commands disabled for the %s plugin", c.Image) return fmt.Errorf("Custom commands disabled for the %s plugin", c.Image)
} }

View file

@ -36,6 +36,9 @@ func Check(c *yaml.Config, trusted bool) error {
// validate the plugin command and entrypoint and return an error // validate the plugin command and entrypoint and return an error
// the user attempts to set or override these values. // the user attempts to set or override these values.
func CheckEntrypoint(c *yaml.Container) error { func CheckEntrypoint(c *yaml.Container) error {
if c.Detached {
return nil
}
if len(c.Entrypoint) != 0 { if len(c.Entrypoint) != 0 {
return fmt.Errorf("Cannot set plugin Entrypoint") return fmt.Errorf("Cannot set plugin Entrypoint")
} }