syndesisio / syndesis-openshift-templates

OpenShift Templates for Syndesis
7 stars 18 forks source link

Extend template mechanism by fragments #38

Closed rhuss closed 7 years ago

rhuss commented 7 years ago

Currently one single huge template file needs to be maintained which is quite error prone.

It would be awesome if this could be split up into smaller parts, which are collected by conventions.

Eg. considering the following file laout:

parameters.yml
svc/
   ipaas-rest-svc.yml
   ipaas-db-svc.yml 
   ....
dc/
   ....
is/
   ....
sa/ 
   ....
cm/
   ....
misc/
   ....

All files are valid mustache templates, but without any extra indentation. The mustache templates are processed during inclusion but before combine stuff. (Drawback: There can be no template directives crossing those snippet files)

Then the generator should include all files in a certain order and create the final files in the format

apiVersion: v1
kind: Template
metadata:
  name: ipaas
parameters:
   <content of parameters.yml>
objects:
   - <all services>
   - <all dcs...>

Optimally an OpenShift Template model object is build up in memory which has the benefit of additional validation. The poor man's solution would be plain text mangling (glueing things together, indenting by two spaces of the included files).

rhuss commented 7 years ago

We already have some templating, and albeit its simpler, its sufficient for now.