---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ meta.name }}-sg-core-configmap
  namespace: {{ meta.namespace }}
data:
  "sg-core.conf.yaml": |
    pluginDir: "{{ plugin_dir | default('/usr/lib64/sg-core') }}"
    logLevel: "{{ log_level | default('info') }}"
    handleErrors: {{ handle_errors | default(True) }}
    blockEventBus: {{ block_event_bus | default(False) }}
    transports:
{% for transport in transports %}
      - name: {{ transport.name }}
{%   if transport.config is defined and transport.config != "" %}
        config: {{ transport.config | from_yaml }}
{%   endif %}
{%   if transport.handlers is defined and transport.handlers != "" %}
        handlers:
{%     for handler in transport.handlers %}
          - name: {{ handler.name }}
{%       if handler.config is defined and handler.config != "" %}
            config: {{ handler.config | from_yaml }}
{%       endif %}
{%     endfor %}
{%   endif %}
{% endfor %}
    applications:
{% for application in applications %}
      - name: {{ application.name }}
{%   if application.config is defined and application.config != "" %}
        config: {{ application.config | from_yaml }}
{%   endif %}
{% endfor %}
# vim: set ft=yaml shiftwidth=2 tabstop=2 expandtab:
