-
Notifications
You must be signed in to change notification settings - Fork 28
/
_duckling.tpl
30 lines (27 loc) · 1001 Bytes
/
_duckling.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{{/*
Determine if endpoint for Duckling is used
*/}}
{{- define "rasa.endpoints.duckling" -}}
{{- if or .Values.duckling.install (and .Values.duckling.external.enabled (not .Values.duckling.external.url)) -}}
{{- print "true" -}}
{{- else -}}
{{- print "false" -}}
{{- end -}}
{{- end -}}
{{/*
Return Duckling URL
*/}}
{{- define "rasa.duckling.url" -}}
{{- if and .Values.duckling.install (not .Values.duckling.external.enabled) -}}
{{- printf "%s://%s-duckling.%s.svc:%d" .Values.duckling.applicationSettings.scheme (include "rasa-common.names.fullname" .) .Release.Namespace (.Values.duckling.service.port | int) -}}
{{- else if and (not .Values.duckling.install) .Values.duckling.external.enabled (not (empty .Values.duckling.external.url)) -}}
{{- print .Values.duckling.external.url -}}
{{- end -}}
{{- end -}}
{{/*
Return the common Duckling env variables.
*/}}
{{- define "rasa.duckling.envs" -}}
- name: "RASA_DUCKLING_HTTP_URL"
value: "{{ include "rasa.duckling.url" . }}"
{{- end -}}