mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-21 10:17:15 +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:
@@ -40,6 +40,7 @@ type Config struct {
|
|||||||
FailOnBundleErrors bool `yaml:"fail_on_bundles_errors,omitempty"`
|
FailOnBundleErrors bool `yaml:"fail_on_bundles_errors,omitempty"`
|
||||||
Bundles Bundles `yaml:"bundles,omitempty"`
|
Bundles Bundles `yaml:"bundles,omitempty"`
|
||||||
GrubOptions map[string]string `yaml:"grub_options,omitempty"`
|
GrubOptions map[string]string `yaml:"grub_options,omitempty"`
|
||||||
|
Env []string `yaml:"env,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Bundles []Bundle
|
type Bundles []Bundle
|
||||||
|
16
pkg/utils/env.go
Normal file
16
pkg/utils/env.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func SetEnv(env []string) {
|
||||||
|
|
||||||
|
for _, e := range env {
|
||||||
|
pair := strings.SplitN(e, "=", 2)
|
||||||
|
if len(pair) >= 2 {
|
||||||
|
os.Setenv(pair[0], pair[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user