From f010c1303c10476904981fb3cb50694522ba230f Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 4 Jun 2024 08:10:13 -0700 Subject: [PATCH] Add migrate timeout option to values (#129) Signed-off-by: Tamal Saha --- charts/openfga/templates/job.yaml | 5 +++++ charts/openfga/values.schema.json | 25 +++++++++++++++++-------- charts/openfga/values.yaml | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/charts/openfga/templates/job.yaml b/charts/openfga/templates/job.yaml index 4eda08b..69778e0 100644 --- a/charts/openfga/templates/job.yaml +++ b/charts/openfga/templates/job.yaml @@ -51,6 +51,11 @@ spec: name: "{{ .Values.datastore.uriSecret }}" key: "uri" {{- end }} + + {{- if .Values.migrate.timeout }} + - name: OPENFGA_TIMEOUT + value: "{{ .Values.migrate.timeout }}" + {{- end }} resources: {{- toYaml .Values.datastore.migrations.resources | nindent 12 }} {{- if .Values.migrate.sidecars }} diff --git a/charts/openfga/values.schema.json b/charts/openfga/values.schema.json index 89f6115..19f5c9b 100644 --- a/charts/openfga/values.schema.json +++ b/charts/openfga/values.schema.json @@ -924,15 +924,24 @@ "type": "array", "description": "add additional sidecar containers to the migration job", "default": [] - } - }, - "annotations": { - "type": "object", - "description": "Map of annotations to add to the migration job's manifest", - "additionalProperties": { - "type": "string" }, - "default": {} + "annotations": { + "type": "object", + "description": "Map of annotations to add to the migration job's manifest", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "timeout": { + "type": [ + "string", + "null" + ], + "description": "A timeout for the time it takes the migrate process to connect to the database", + "format": "duration", + "default": "1m" + } } }, "extraEnvVars": { diff --git a/charts/openfga/values.yaml b/charts/openfga/values.yaml index 0564d9d..5222fe7 100644 --- a/charts/openfga/values.yaml +++ b/charts/openfga/values.yaml @@ -325,3 +325,4 @@ migrate: helm.sh/hook-weight: "-5" helm.sh/hook-delete-policy: "before-hook-creation" labels: {} + timeout: