fix templater: Guard against empty values map

This commit is contained in:
Vincent Ambo 2017-02-08 13:47:56 +01:00
parent a1c23d7018
commit 3ef0f35bfe

View file

@ -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 {