plugins: fix passing additional environment variables
Some checks failed
Docker / Build (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Has been cancelled
CI / Test and deploy (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-11-05 18:06:58 +01:00
parent 88b1850b58
commit 82b437c502
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -144,7 +144,7 @@ func (c *Config) getCommand() *exec.Cmd {
} }
logger.Debug(logSender, "", "additional env vars for plugin %q: %+v", c.Cmd, c.EnvVars) logger.Debug(logSender, "", "additional env vars for plugin %q: %+v", c.Cmd, c.EnvVars)
for _, key := range c.EnvVars { for _, key := range c.EnvVars {
cmd.Env = append(cmd.Env, os.Getenv(key)) cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", key, os.Getenv(key)))
} }
return cmd return cmd
} }