mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 19:38:37 +02:00
documentation updates and tweaking workflows with env vars. It now throws errors if they're not set
This commit is contained in:
+7
-1
@@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"errors"
|
||||
|
||||
"github.com/roboll/helmfile/helmexec"
|
||||
|
||||
@@ -164,7 +165,12 @@ func flagsForChart(chart *ChartSpec) ([]string, error) {
|
||||
if len(chart.EnvValues) > 0 {
|
||||
val := []string{}
|
||||
for _, set := range chart.EnvValues {
|
||||
val = append(val, fmt.Sprintf("%s=%s", set.Name, os.Getenv(set.Value)))
|
||||
value, isSet := os.LookupEnv(set.Value)
|
||||
if isSet {
|
||||
val = append(val, fmt.Sprintf("%s=%s", set.Name, value))
|
||||
} else {
|
||||
return nil, errors.New(fmt.Sprintf("Unset env var: %s", set.Name))
|
||||
}
|
||||
}
|
||||
flags = append(flags, "--set", strings.Join(val, ","))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user