2021-03-03 15:51:25 +00:00
|
|
|
{{/*
|
|
|
|
Renders the Service objects required by the chart by returning a concatinated list
|
|
|
|
of the main Service and any additionalServices.
|
|
|
|
*/}}
|
|
|
|
{{- define "common.services" -}}
|
|
|
|
{{- if .Values.services -}}
|
2021-03-12 15:56:04 +00:00
|
|
|
{{- /* Add dict of primary services */ -}}
|
2021-03-03 15:51:25 +00:00
|
|
|
{{- range $name, $service := .Values.services }}
|
|
|
|
{{- if or ( $service.enabled ) ( eq $name "main" ) -}}
|
|
|
|
{{- print ("---") | nindent 0 -}}
|
|
|
|
{{- print ("\n") | nindent 0 -}}
|
|
|
|
{{- $serviceValues := $service -}}
|
2021-03-12 15:56:04 +00:00
|
|
|
|
|
|
|
{{- /* Dont add name suffix for primary service named "main" */ -}}
|
|
|
|
{{- if and (not $serviceValues.nameSuffix) ( ne $name "main" ) -}}
|
2021-03-03 15:51:25 +00:00
|
|
|
{{- $_ := set $serviceValues "nameSuffix" $name -}}
|
|
|
|
{{ end -}}
|
|
|
|
{{- $_ := set $ "ObjectValues" (dict "service" $serviceValues) -}}
|
|
|
|
{{- include "common.classes.service" $ -}}
|
2021-03-11 16:41:17 +00:00
|
|
|
{{- end }}
|
2021-03-03 15:51:25 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
|
|
|
|
{{- if .Values.additionalServices -}}
|
|
|
|
{{- /* Generate additional services as required */ -}}
|
|
|
|
{{- range $index, $extraService := .Values.additionalServices }}
|
|
|
|
{{- if $extraService.enabled -}}
|
|
|
|
{{- print ("---") | nindent 0 -}}
|
|
|
|
{{- $serviceValues := $extraService -}}
|
2021-03-05 21:31:02 +00:00
|
|
|
|
2021-03-12 15:56:04 +00:00
|
|
|
{{- $name := $index -}}
|
2021-03-05 21:31:02 +00:00
|
|
|
{{- if $serviceValues.name -}}
|
|
|
|
{{- $name := $serviceValues.name -}}
|
|
|
|
{{- end }}
|
|
|
|
|
2021-03-12 15:56:04 +00:00
|
|
|
{{- /* Dont add name suffix for primary service named "main" */ -}}
|
|
|
|
{{- if and (not $serviceValues.nameSuffix) ( ne ( $name | quote ) "main" ) -}}
|
2021-03-05 21:31:02 +00:00
|
|
|
{{- $_ := set $serviceValues "nameSuffix" $name -}}
|
2021-03-03 15:51:25 +00:00
|
|
|
{{ end -}}
|
|
|
|
{{- $_ := set $ "ObjectValues" (dict "service" $serviceValues) -}}
|
|
|
|
{{- include "common.classes.service" $ -}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|