apiVersion: v1
kind: ConfigMap
metadata:
  name: turbodif-config-{{ .Release.Name }}
data:
  turbodif-config.json: |-
    {
      "communicationConfig": {
        "serverMeta": {
          "version": "{{ .Values.serverMeta.version }}",
          "turboServer": "{{ .Values.serverMeta.turboServer }}"
        },
        "restAPIConfig": {
          "opsManagerUserName": "{{ .Values.restAPIConfig.opsManagerUserName }}",
          "opsManagerPassword": "{{ .Values.restAPIConfig.opsManagerPassword }}"
        }
      {{- if and .Values.targetName .Values.targetAddress }}
      },
      "targetConfig": {
        "targetName": "{{ .Values.targetName }}",
        "targetAddress": "{{ .Values.targetAddress }}"
      {{- end }}
      {{- if .Values.targetTypeSuffix }}
      },
      "targetTypeSuffix": "{{ .Values.targetTypeSuffix }}"
      {{- else }}
      }
      {{- end }}
    }
