diff --git a/charts/openfga/templates/deployment.yaml b/charts/openfga/templates/deployment.yaml index d4e2cf4..728bca7 100644 --- a/charts/openfga/templates/deployment.yaml +++ b/charts/openfga/templates/deployment.yaml @@ -34,8 +34,9 @@ spec: serviceAccountName: {{ include "openfga.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if and (has .Values.datastore.engine (list "postgres" "mysql")) .Values.datastore.applyMigrations .Values.datastore.waitForMigrations }} + {{ if or (and (has .Values.datastore.engine (list "postgres" "mysql")) .Values.datastore.applyMigrations .Values.datastore.waitForMigrations) .Values.extraInitContainers }} initContainers: + {{- if and (has .Values.datastore.engine (list "postgres" "mysql")) .Values.datastore.applyMigrations .Values.datastore.waitForMigration }} - name: wait-for-migration securityContext: {{- toYaml .Values.securityContext | nindent 12 }} @@ -44,6 +45,10 @@ spec: args: ["job", '{{ include "openfga.fullname" . }}-migrate'] resources: {{- toYaml .Values.datastore.migrations.resources | nindent 12 }} + {{- end }} + {{- with .Values.extraInitContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} diff --git a/charts/openfga/values.schema.json b/charts/openfga/values.schema.json index 66c5369..89f6115 100644 --- a/charts/openfga/values.schema.json +++ b/charts/openfga/values.schema.json @@ -959,6 +959,14 @@ }, "default": [] }, + "extraInitContainers": { + "type": "array", + "description": "List of additional initContainers to add to the deployment", + "items": { + "type": "object" + }, + "default": [] + }, "initContainer": { "type": "object", "description": "", diff --git a/charts/openfga/values.yaml b/charts/openfga/values.yaml index 89369f0..0564d9d 100644 --- a/charts/openfga/values.yaml +++ b/charts/openfga/values.yaml @@ -25,6 +25,7 @@ podAnnotations: {} extraEnvVars: [] extraVolumes: [] extraVolumeMounts: [] +extraInitContainers: [] podSecurityContext: {}