about summary refs log tree commit diff
path: root/templater
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-02-08T12·47+0100
committerVincent Ambo <tazjin@gmail.com>2017-02-08T12·47+0100
commit3ef0f35bfeb73adbe6b205b7bdd54ea6a49f1c97 (patch)
treeac35179ac4b9a8dfb7ad190626cc1a0d24f33d6f /templater
parenta1c23d701826aa4ab963416946ff7054aabc1a7a (diff)
fix templater: Guard against empty values map
Diffstat (limited to 'templater')
-rw-r--r--templater/templater.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/templater/templater.go b/templater/templater.go
index a2c860c60d3d..5c1db77aadfd 100644
--- a/templater/templater.go
+++ b/templater/templater.go
@@ -99,6 +99,11 @@ func templateFile(c *context.Context, rs *context.ResourceSet, filename string)
 
 	var b bytes.Buffer
 
+	// Guard against empty map before merging keys
+	if rs.Values == nil {
+		rs.Values = make(map[string]interface{}, 0)
+	}
+
 	// Merge global and resourceset-specific values (don't override from global)
 	for k, v := range c.Global {
 		if _, ok := rs.Values[k]; !ok {