fn framework -- add support for patch templates

This commit is contained in:
Phillip Wittrock
2020-11-16 11:26:22 -08:00
parent bd0a699ff6
commit 02b14d919b
29 changed files with 941 additions and 42 deletions

View File

@@ -256,6 +256,9 @@ type TemplateCommand struct {
// Templates is a list of templates to render.
Templates []*template.Template
// PatchTemplates is a list of templates to render into Patches and apply.
PatchTemplates []PatchTemplate
// TemplateFiles list of templates to read from disk which are appended
// to Templates.
TemplatesFiles []string
@@ -342,6 +345,12 @@ func (tc TemplateCommand) GetCommand() cobra.Command {
}
}
for i := range tc.PatchTemplates {
if err := tc.PatchTemplates[i].Apply(&rl); err != nil {
return err
}
}
var err error
if tc.MergeResources {
rl.Items, err = filters.MergeFilter{}.Filter(rl.Items)