in pkg/build/patchbuild.go [129:154]
func AllPatchTemplates(bw *wrapper.BundleWrapper, fopts *filter.Options, opts options.JSONOptions) (*wrapper.BundleWrapper, error) {
switch bw.Kind() {
case "Component":
comp, err := ComponentPatchTemplates(bw.Component(), fopts, opts)
if err != nil {
return nil, err
}
bw = wrapper.FromComponent(comp)
case "Bundle":
bun := bw.Bundle()
var comps []*bundle.Component
for _, comp := range bun.Components {
comp, err := ComponentPatchTemplates(comp, fopts, opts)
if err != nil {
return nil, err
}
comps = append(comps, comp)
}
bun.Components = comps
bw = wrapper.FromBundle(bun)
default:
return nil, fmt.Errorf("bundle kind %q not supported for patching", bw.Kind())
}
return bw, nil
}