mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-17 23:37:44 +00:00
set configScanDir as package scoped var (#264)
set config.Install.env variables in environment adding env to config to use across all stages switch to config.Scan to read config
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -227,14 +226,8 @@ func RunInstall(options map[string]string) error {
|
||||
c.Install.Reboot = true
|
||||
}
|
||||
|
||||
for _, e := range c.Install.Env {
|
||||
pair := strings.SplitN(e, "=", 2)
|
||||
if len(pair) >= 2 {
|
||||
os.Setenv(pair[0], pair[1])
|
||||
}
|
||||
}
|
||||
|
||||
envs := os.Environ()
|
||||
env := append(c.Install.Env, c.Env...)
|
||||
utils.SetEnv(env)
|
||||
|
||||
err := ioutil.WriteFile(f.Name(), []byte(cloudInit), os.ModePerm)
|
||||
if err != nil {
|
||||
@@ -246,7 +239,7 @@ func RunInstall(options map[string]string) error {
|
||||
args = append(args, "-c", f.Name(), device)
|
||||
|
||||
cmd := exec.Command("elemental", args...)
|
||||
cmd.Env = envs
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stderr = os.Stderr
|
||||
|
Reference in New Issue
Block a user