{{- $name := include "webhooks-web.fullname" . -}}
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
{{- $webhooksweb := include "url-of" (list .Values.app.ingress.entries.webhooksweb .) -}}
{{- $webhooks := include "url-of" (list .Values.app.ingress.entries.webhooks .) -}}
{{- $protocol := include "protocol" . -}}

apiVersion: v1
kind: ConfigMap
metadata:
  name: "cfg-{{ $name }}"
  labels:
    app: {{ template "webhooks-web.name" . }}
    chart: {{ template "webhooks-web.chart" .}}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  urls__webhooks: {{ $protocol }}://{{ $webhooks }}
  identity_e: {{ $protocol }}://{{ $identity }}
  webhooksweb_e: {{ $protocol }}://{{ $webhooksweb }}
  urls_webhooksweb: http://{{ .Values.app.svc.webhooksweb }}
