From d26b69411f755dd5a73271490dc4219b1a510687 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 2 Mar 2023 10:59:09 -0500 Subject: [PATCH] remove logging for missing `SecureConfig` (#238) In #207 we introduced a warning if the `SecureConfig` is unset. For Nomad and other applications that have "internal" go-plugin consumers where the application runs itself as a plugin, this causes spurious warn-level logs. For Nomad in particular this means every task driver and logmon invocation emits the log, which is our primary operation. Setting a `SecureConfig` isn't required, and if a given go-plugin consumer requires it to be, this seems more like a programming error than a runtime error. Remove the log line. --- client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client.go b/client.go index fb0329b4..a6a9ffa2 100644 --- a/client.go +++ b/client.go @@ -568,9 +568,7 @@ func (c *Client) Start() (addr net.Addr, err error) { return nil, err } - if c.config.SecureConfig == nil { - c.logger.Warn("plugin configured with a nil SecureConfig") - } else { + if c.config.SecureConfig != nil { if ok, err := c.config.SecureConfig.Check(cmd.Path); err != nil { return nil, fmt.Errorf("error verifying checksum: %s", err) } else if !ok {