Skip to content

Commit

Permalink
ussd-engine: add language strings file config
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxpiper committed Jul 9, 2022
1 parent a5311a3 commit ff16c68
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/ussd-engine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: ushahidi-ussd-engine
version: 0.0.1-alpha.4
version: 0.0.1-alpha.5
icon: https://github.ushahidi.org/helm-charts/icon.png
10 changes: 10 additions & 0 deletions charts/ussd-engine/templates/lang_strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.config.lang_strings_file }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ussd-engine-lang-strings
data:
lang_strings.json: |-
{{ toPrettyJson .Values.config.lang_strings_file | indent 4 }}
{{- end }}
18 changes: 16 additions & 2 deletions charts/ussd-engine/templates/ussd-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,33 @@ spec:
cpu: {{ .Values.requests.cpu }}
memory: {{ .Values.requests.memory }}

{{- if .Values.config.settings_file }}
{{- if or .Values.config.settings_file .Values.config.lang_strings_file }}
volumeMounts:
{{- if .Values.config.settings_file }}
- name: config-settings-file
mountPath: /var/www/settings.json
subPath: settings.json
{{- end }}
{{- if .Values.config.lang_strings_file }}
- name: config-lang-strings-file
mountPath: /var/www/lang_strings.json
subPath: lang_strings.json
{{- end }}
{{- end }}

{{- if .Values.config.settings_file }}
{{- if or .Values.config.settings_file .Values.config.lang_strings_file }}
volumes:
{{- if .Values.config.settings_file }}
- name: config-settings-file
configMap:
name: ussd-engine-settings
{{- end }}
{{- if .Values.config.lang_strings_file }}
- name: config-lang-strings-file
configMap:
name: ussd-engine-lang-strings
{{- end }}
{{- end }}

terminationGracePeriodSeconds: 15

Expand Down
8 changes: 8 additions & 0 deletions charts/ussd-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ config:
# description: ignore
# other: ignore

# this maps to the lang_strings.json file
# lang_strings_file:
# en:
# conversation.selectSurvey: Make your pick
# es:
# conversation.selectSurvey: Elija uno


replicas: 1
debug: "False"
params:
Expand Down

0 comments on commit ff16c68

Please sign in to comment.