From 532627deed632a73ea676fdbaf2343948146d183 Mon Sep 17 00:00:00 2001 From: Vladislav Kuzmin Date: Thu, 1 Apr 2021 15:21:07 +0400 Subject: [PATCH] Use env variables only for exec process in KRM toolbox Small improvement that allows env variables to be used only for exec process in the KRM toolbox. Change-Id: I93436813be883241996ab46154d78452804a8665 --- krm-functions/toolbox/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/krm-functions/toolbox/main.go b/krm-functions/toolbox/main.go index 281ec186c..74e602e03 100644 --- a/krm-functions/toolbox/main.go +++ b/krm-functions/toolbox/main.go @@ -92,12 +92,13 @@ func (c *ScriptRunner) Run() error { c.ResourceList.Items = nil - os.Setenv(EnvRenderedBundlePath, bundlePath) - clicmd := exec.Command(scriptPath) clicmd.Stdout = c.OutStream clicmd.Stderr = c.ErrStream + clicmd.Env = os.Environ() + clicmd.Env = append(clicmd.Env, fmt.Sprintf("%s=%s", EnvRenderedBundlePath, bundlePath)) + err = clicmd.Start() if err != nil { return err