feat context: Support resource set default values

This adds functionality to specify default values directly in resource sets.

The idea is that users can create a file called `values.yaml` or `values.json`
in a resource set's folder and have all variables specified in that file be
automatically merged into the resource set variables with the lowest priority.

This fixes #25
This fixes #30 (to a degree)
This commit is contained in:
Vincent Ambo 2017-04-04 14:28:22 +02:00
parent 4eadb58841
commit 11cfc80020
4 changed files with 65 additions and 3 deletions

View file

@ -140,3 +140,17 @@ func TestSubresourceVariableInheritanceOverride(t *testing.T) {
t.Fail()
}
}
func TestDefaultValuesLoading(t *testing.T) {
ctx, err := LoadContextFromFile("testdata/default-loading.yaml")
if err != nil {
t.Error(err)
t.Fail()
}
rs := ctx.ResourceSets[0]
if rs.Values["defaultValues"] != "loaded" {
t.Errorf("Default values not loaded from YAML file")
t.Fail()
}
}