From 3ef0f35bfeb73adbe6b205b7bdd54ea6a49f1c97 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 8 Feb 2017 13:47:56 +0100 Subject: [PATCH] fix templater: Guard against empty values map --- templater/templater.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templater/templater.go b/templater/templater.go index a2c860c60..5c1db77aa 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 {