mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-18 02:01:29 +00:00
explicitly specify envs to be exported in function
This commit is contained in:
@@ -5,8 +5,6 @@ package container
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
runtimeexec "sigs.k8s.io/kustomize/kyaml/fn/runtime/exec"
|
||||
"sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil"
|
||||
@@ -177,19 +175,7 @@ func (c *Filter) getCommand() (string, []string) {
|
||||
args = append(args, "--mount", storageMount.String())
|
||||
}
|
||||
|
||||
// TODO: put these env processes into a separate function and call it in the outside of
|
||||
// getCommand
|
||||
os.Setenv("LOG_TO_STDERR", "true")
|
||||
os.Setenv("STRUCTURED_RESULTS", "true")
|
||||
|
||||
// export the local environment vars to the container
|
||||
for _, pair := range os.Environ() {
|
||||
items := strings.Split(pair, "=")
|
||||
if items[0] == "" || items[1] == "" || items[0] == tmpDirEnvKey {
|
||||
continue
|
||||
}
|
||||
args = append(args, "-e", items[0])
|
||||
}
|
||||
args = append(args, c.Envs.GetDockerFlags()...)
|
||||
a := append(args, c.Image)
|
||||
return "docker", a
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user