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
This commit is contained in:
parent
063a3e9d30
commit
b20bc5f57a
3 changed files with 8 additions and 5 deletions
|
|
@ -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") ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue