Skip to content

Commit

Permalink
feat: Add templating functionality to extraContainers (#310)
Browse files Browse the repository at this point in the history
* Allow templating in extraContainers

Adjust template logic for `extraContainers` across multiple Helm deployment files to support both string and non-string types.

* Update flagsmith chart version to 0.68.0
  • Loading branch information
otherguy authored Jan 22, 2025
1 parent c97f5ba commit 626d6a2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.67.1
version: 0.68.0
appVersion: 2.159.0
dependencies:
- name: postgresql
Expand Down
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ spec:
resources:
{{ toYaml .Values.api.resources | indent 10 }}
{{- with .Values.api.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- if .Values.api.influxdbSetup.enabled }}
Expand Down
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ spec:
resources:
{{ toYaml .Values.frontend.resources | indent 10 }}
{{- with .Values.frontend.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.frontend.extraVolumes }}
Expand Down
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/deployment-pgbouncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ spec:
resources:
{{ toYaml .Values.pgbouncer.resources | indent 10 }}
{{- with .Values.pgbouncer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.pgbouncer.extraVolumes }}
Expand Down
8 changes: 6 additions & 2 deletions charts/flagsmith/templates/deployment-sse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ spec:
resources:
{{ toYaml .Values.sse.resources | indent 10 }}
{{- with .Values.sse.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.sse.extraVolumes }}
Expand All @@ -109,4 +113,4 @@ spec:
{{- with .Values.sse.extraSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/deployment-task-processor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ spec:
resources:
{{ toYaml .Values.taskProcessor.resources | indent 10 }}
{{- with .Values.taskProcessor.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.taskProcessor.extraVolumes }}
Expand Down
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/jobs-migrate-analytics-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ spec:
{{- end }}
env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
{{- with .Values.jobs.migrateDb.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.jobs.migrateDb.extraVolumes }}
Expand Down
6 changes: 5 additions & 1 deletion charts/flagsmith/templates/jobs-migrate-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ spec:
{{- end }}
env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
{{- with .Values.jobs.migrateDb.extraContainers }}
{{- toYaml . | nindent 6 }}
{{ if typeIs "string" . }}
{{- tpl . $ | nindent 6 }}
{{- else }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
volumes:
{{- with .Values.jobs.migrateDb.extraVolumes }}
Expand Down

0 comments on commit 626d6a2

Please sign in to comment.