Skip to content

Commit

Permalink
Preserve environment for extension backend
Browse files Browse the repository at this point in the history
Commands executed for the extension backend poreserve the existing
process environment adding flannel specific variables instead of
replacing the whole environment.

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
  • Loading branch information
jcaamano committed Jan 27, 2021
1 parent 14d007b commit 6c0ec9a
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 6c0ec9a

Please sign in to comment.