about summary refs log tree commit diff
path: root/context/context.go
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-02-08T16·32+0100
committerVincent Ambo <tazjin@gmail.com>2017-02-08T16·42+0100
commitdd2fdd63e5c1fdaed0eb5116e32724068495fae7 (patch)
treebfe613e17f78b586c5dee327c662db89440b748a /context/context.go
parent756a4c745d111e74c2c673009e14b14b1cd8141f (diff)
fix templater & ctx: Correctly check resource set parent
Diffstat (limited to 'context/context.go')
-rw-r--r--context/context.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/context/context.go b/context/context.go
index 2de78541e7e6..108bda28a90d 100644
--- a/context/context.go
+++ b/context/context.go
@@ -17,7 +17,7 @@ type ResourceSet struct {
 
 	// Fields for resource set collections
 	Include []ResourceSet `json:"include"`
-	Parent  *string
+	Parent  string
 }
 
 type Context struct {
@@ -63,6 +63,7 @@ func LoadContextFromFile(filename string) (*Context, error) {
 		)
 	}
 
+	c.ResourceSets = *flattenResourceSetCollections(&c.ResourceSets)
 	c.BaseDir = path.Dir(filename)
 
 	return &c, nil
@@ -79,7 +80,7 @@ func flattenResourceSetCollections(rs *[]ResourceSet) *[]ResourceSet {
 			flattened = append(flattened, r)
 		} else {
 			for _, subResourceSet := range r.Include {
-				subResourceSet.Parent = &r.Name
+				subResourceSet.Parent = r.Name
 				subResourceSet.Name = path.Join(r.Name, subResourceSet.Name)
 				flattened = append(flattened, subResourceSet)
 			}