plugins: fix passing additional environment variables
Some checks failed
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
Docker / Build (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 b4acae85b8
commit dda89185fb
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -143,7 +143,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
} }