about summary refs log tree commit diff
path: root/context/context_test.go
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-04-04T12·28+0200
committerVincent Ambo <tazjin@gmail.com>2017-04-04T18·06+0200
commit11cfc80020010ff949de767698124cc5719361e0 (patch)
treec5db424c0b8b7574029d53b033b06e4baa029618 /context/context_test.go
parent4eadb588412af8f2028ed5a71037c45f7caff269 (diff)
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)
Diffstat (limited to 'context/context_test.go')
-rw-r--r--context/context_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/context/context_test.go b/context/context_test.go
index 4c95f058c0f1..8da30c9a89b0 100644
--- a/context/context_test.go
+++ b/context/context_test.go
@@ -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()
+	}
+}