diff options
author | Vincent Ambo <tazjin@gmail.com> | 2017-08-31T16·37+0200 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2017-08-31T16·41+0200 |
commit | b20bc5f57a9e4e25760f03de752c2ed2811fa5fe (patch) | |
tree | c61a99691557b08977e1a79db59556c2a83be8b2 /templater/templater.go | |
parent | 063a3e9d3037c77aea765d7c58bff567b21d5946 (diff) |
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
Diffstat (limited to 'templater/templater.go')
-rw-r--r-- | templater/templater.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/templater/templater.go b/templater/templater.go index 4a0c8e7d8d8a..f6878d3dfa03 100644 --- a/templater/templater.go +++ b/templater/templater.go @@ -186,8 +186,10 @@ func templateFuncs() template.FuncMap { // Checks whether a file is a resource file (i.e. is YAML or JSON) and not a default values file. func isResourceFile(f os.FileInfo) bool { - if f.Name() == "default.json" || f.Name() == "default.yaml" { - return false + for _, defaultFile := range util.DefaultFilenames { + if f.Name() == defaultFile { + return false + } } return strings.HasSuffix(f.Name(), "yaml") || |