mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
Configurable extensions for template parser
This commit is contained in:
@@ -61,7 +61,7 @@ func TemplateStrings(data ...string) framework.TemplateParser {
|
||||
// }},
|
||||
// }
|
||||
func TemplateFiles(paths ...string) TemplateParser {
|
||||
return TemplateParser{parser{paths: paths, extension: TemplateExtension}}
|
||||
return TemplateParser{parser{paths: paths, extensions: []string{TemplateExtension}}}
|
||||
}
|
||||
|
||||
// TemplateParser is a framework.TemplateParser that can parse files or directories containing Go templated YAML.
|
||||
@@ -95,3 +95,9 @@ func (l TemplateParser) FromFS(fs iofs.FS) TemplateParser {
|
||||
l.parser.fs = fs
|
||||
return l
|
||||
}
|
||||
|
||||
// WithExtensions allows you to replace the extension the parser accept on the input files.
|
||||
func (l TemplateParser) WithExtensions(ext ...string) TemplateParser {
|
||||
l.parser.extensions = ext
|
||||
return l
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user