Skip to content

Commit

Permalink
extension be: append env instead of replace
Browse files Browse the repository at this point in the history
Append to the existing environment instead of replacing it when adding
backend especific variables.

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
  • Loading branch information
jcaamano committed Jan 26, 2021
1 parent 68e6442 commit 765a6c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package extension
import (
"fmt"
"io"
"os"
"strings"

"encoding/json"
Expand Down Expand Up @@ -133,7 +134,7 @@ func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGr
// Run a cmd, returning a combined stdout and stderr.
func runCmd(env []string, stdin string, name string, arg ...string) (string, error) {
cmd := exec.Command(name, arg...)
cmd.Env = env
cmd.Env = append(os.Environ(), env...)

stdinpipe, err := cmd.StdinPipe()
if err != nil {
Expand Down

0 comments on commit 765a6c7

Please sign in to comment.