{{- $name := include "webmvc.fullname" . -}}
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}}


apiVersion: v1
kind: ConfigMap
metadata:
  name: "cfg-{{ $name }}"
  labels:
    app: {{ template "webmvc.name" . }}
    chart: {{ template "webmvc.chart" .}}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
  all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
  all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
  webmvc__keystore: {{ .Values.inf.redis.keystore.constr }}
  internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }}
  internalurls__apigwwm: http://{{ .Values.app.svc.webmarketingapigw }}
  internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc
  internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc
  internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc
  internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc
  internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
  internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
  urls__apigwws: http://{{ $webshoppingapigw }}
  urls__mvc: http://{{ $mvc }}
  urls__IdentityUrl: http://{{ $identity }}