mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
fn framework -- add support for patch templates
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user