[~psturc]
Good approach...
I am +1 on that. I see no problems.
We actually need something very very similar at the sync side now. See AEROGEAR-8512 As we now support multiple instances of sync apps in a namespace, we need to create the Grafana dashboard per sync app. There we need to support the same scenario. But the more problematic part there is, we don't know the "temporary" config map there. We would probably append the sync app name to the config map and we need to patch the {[grafana-dashboards-configmap}} with them.
Steps:
h4. Steps
During keycloak-apb provision with sync app name "foo": * create {{sync-dashboard-foo}} configmap from json file **template** (if previous instance of {{sync-app-apb}} hasn't created it yet with the same name) or if {{grafana-dashboards-configmap}} doesn't exist If {{grafana-dashboards-configmap}} exists(i.e. metrics-apb is already provisioned), patch it immediately with the template.
I am telling "template" here as we will have some references in the dashboard to the sync app name. We need to convert them to placeholders. e.g. [this line | https://github.com/aerogearcatalog/data-sync-apb/blob/master/roles/provision-data-sync-apb/files/data-sync-dashboard.json#L111]
During metrics-apb provision * create {{grafana-dashboards-configmap}} * iterate over the {{sync-dashboard-*}} configmaps * Patch {{grafana-dashboards-configmap}} configmap with {{sync-dashboard-xyz}} configmap content and delete {{sync-dashboard-xyz}} configmap from project |
|