2018-06-15 15:27:18 +02:00

37 lines
827 B
Smarty

{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.app.ingress.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
{{- end -}}
{{- end -}}
{{ define "pathBase" -}}
{{- if .Values.app.ingress.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}