mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 11:20:23 +02:00
feat: inject cli state values (--state-values-set) into environment templating context (#1917)
* feat: inject cli state values (--state-values-set) into environment templating context Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com> * test: added envvals_loader unit test for environment values Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com> * test: added 'state values set cli args in environments' integration test Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com> * fix: merge environments before loadValuesEntries Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com> * fix: 'state values set cli args in environments' integration test Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com> --------- Signed-off-by: Vincent Chenal <vincent.chenal@protonmail.com>
This commit is contained in:
@@ -228,3 +228,22 @@ func TestEnvValsLoad_MultiHCL(t *testing.T) {
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnvValsLoad_EnvironmentValues(t *testing.T) {
|
||||
l := newLoader()
|
||||
env := environment.New("test")
|
||||
env.Values["foo"] = "bar"
|
||||
|
||||
actual, err := l.LoadEnvironmentValues(nil, []any{"testdata/values.9.yaml.gotmpl"}, env, "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
expected := map[string]any{
|
||||
"foo": "bar",
|
||||
}
|
||||
|
||||
if diff := cmp.Diff(expected, actual); diff != "" {
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user