From 3935703286b638c6e6fadd97a4a36ec00312768f Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 13 Oct 2016 16:41:33 -0700 Subject: [PATCH 1/2] Supress plugin discovery from plugins, which is redundant and noisy in the logs --- config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.go b/config.go index 07a64d0af..98f65f070 100644 --- a/config.go +++ b/config.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "log" + "os" "os/exec" "path/filepath" "runtime" @@ -46,6 +47,12 @@ func decodeConfig(r io.Reader, c *config) error { // Hence, the priority order is the reverse of the search order - i.e., the // CWD has the highest priority. func (c *config) Discover() error { + // If we are already inside a plugin process we should not need to + // discover anything. + if os.Getenv(plugin.MagicCookieKey) != "" { + return nil + } + // First, look in the same directory as the executable. exePath, err := osext.Executable() if err != nil { From 010fa977cf8a0885297407ec05def33c986ec398 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 13 Oct 2016 18:14:22 -0700 Subject: [PATCH 2/2] Change to explicit comparison with MagicCookieValue --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 98f65f070..801d73437 100644 --- a/config.go +++ b/config.go @@ -49,7 +49,7 @@ func decodeConfig(r io.Reader, c *config) error { func (c *config) Discover() error { // If we are already inside a plugin process we should not need to // discover anything. - if os.Getenv(plugin.MagicCookieKey) != "" { + if os.Getenv(plugin.MagicCookieKey) == plugin.MagicCookieValue { return nil }