From b20bc5f57a9e4e25760f03de752c2ed2811fa5fe Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 31 Aug 2017 18:37:57 +0200 Subject: fix templater: Don't template default.yml files After the change from #84 default variable files with the '.yml' extension got templated as resource set templates accidentally. This resolves the issue by moving the list reserved default file names to a common place and reusing it in both the templater and context pkg. This fixes #85 --- context/context.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'context') diff --git a/context/context.go b/context/context.go index fe04a051efed..0be42d6d222b 100644 --- a/context/context.go +++ b/context/context.go @@ -143,9 +143,7 @@ func loadAllDefaultValues(c *Context) []ResourceSet { func loadDefaultValues(rs *ResourceSet, c *Context) *map[string]interface{} { var defaultVars map[string]interface{} - defaultFilenames := []string{"default.yml", "default.yaml", "default.json"} - - for _, filename := range defaultFilenames { + for _, filename := range util.DefaultFilenames { err := util.LoadJsonOrYaml(path.Join(c.BaseDir, rs.Path, filename), &defaultVars) if err == nil { return util.Merge(&defaultVars, &rs.Values) -- cgit 1.4.1