From 58682aa6a7f23a334e4835a1a99f1bb5fc6f4f47 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 25 Nov 2016 10:32:12 +0100 Subject: [PATCH] fixes issues running services in detached mode --- yaml/transform/image.go | 9 +++++++++ yaml/transform/validate.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/yaml/transform/image.go b/yaml/transform/image.go index 69aee974..514f0d6c 100644 --- a/yaml/transform/image.go +++ b/yaml/transform/image.go @@ -40,6 +40,15 @@ func ImageEscalate(conf *yaml.Config, patterns []string) error { for _, c := range conf.Pipeline { for _, pattern := range patterns { 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 { return fmt.Errorf("Custom commands disabled for the %s plugin", c.Image) } diff --git a/yaml/transform/validate.go b/yaml/transform/validate.go index 161280dc..efcd1710 100644 --- a/yaml/transform/validate.go +++ b/yaml/transform/validate.go @@ -36,6 +36,9 @@ func Check(c *yaml.Config, trusted bool) error { // validate the plugin command and entrypoint and return an error // the user attempts to set or override these values. func CheckEntrypoint(c *yaml.Container) error { + if c.Detached { + return nil + } if len(c.Entrypoint) != 0 { return fmt.Errorf("Cannot set plugin Entrypoint") }