(schemas []*SchemaWithPolicy, tpl *pongo2.Template, version, description, outputPath string)
| 235 | } |
| 236 | |
| 237 | func applyTemplateForEachResourceGroup(schemas []*SchemaWithPolicy, tpl *pongo2.Template, version, description, outputPath string) { |
| 238 | for _, resourceGroup := range getAllResourceGroupsFromSchemas(schemas) { |
| 239 | resourceSchemas := filerSchemasByResourceGroup(resourceGroup, schemas) |
| 240 | output, err := tpl.Execute(pongo2.Context{"schemas": resourceSchemas, "title": resourceGroup, "version": version, "description": description}) |
| 241 | if err != nil { |
| 242 | util.ExitFatal(err) |
| 243 | return |
| 244 | } |
| 245 | outputPath = strings.Replace(outputPath, "__resource__", resourceGroup, 1) |
| 246 | ioutil.WriteFile(outputPath, []byte(output), 0644) |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | func applyTemplateForEachResource(schemas []*SchemaWithPolicy, tpl *pongo2.Template, outputPath string) { |
| 251 | for _, schemaWithPolicy := range schemas { |
no test coverage detected