From 44c6aff9e0dc658f7dac2c00d572a65f2bffd937 Mon Sep 17 00:00:00 2001 From: Pedro Arvela Date: Tue, 6 Jun 2023 21:12:26 +0100 Subject: [PATCH] fix(openfga): allow migration without embedded db (#34) --- charts/openfga/Chart.yaml | 2 +- charts/openfga/templates/deployment.yaml | 2 +- charts/openfga/templates/job.yaml | 2 +- charts/openfga/values.schema.json | 5 +++++ charts/openfga/values.yaml | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/charts/openfga/Chart.yaml b/charts/openfga/Chart.yaml index aef6d05..0d1ca31 100644 --- a/charts/openfga/Chart.yaml +++ b/charts/openfga/Chart.yaml @@ -3,7 +3,7 @@ name: openfga description: A Kubernetes Helm chart for the OpenFGA project. type: application -version: 0.1.14 +version: 0.1.15 appVersion: "v1.0.1" home: "https://openfga.github.io/helm-charts/charts/openfga" diff --git a/charts/openfga/templates/deployment.yaml b/charts/openfga/templates/deployment.yaml index bf2d6c1..08b65df 100644 --- a/charts/openfga/templates/deployment.yaml +++ b/charts/openfga/templates/deployment.yaml @@ -30,7 +30,7 @@ spec: serviceAccountName: {{ include "openfga.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if or .Values.postgres.enabled .Values.mysql.enabled }} + {{- if and (has .Values.datastore.engine (list "postgres" "mysql")) .Values.datastore.applyMigrations }} initContainers: - name: wait-for-migration image: groundnuty/k8s-wait-for:v1.6 diff --git a/charts/openfga/templates/job.yaml b/charts/openfga/templates/job.yaml index 0721788..daffccf 100644 --- a/charts/openfga/templates/job.yaml +++ b/charts/openfga/templates/job.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.postgres.enabled .Values.mysql.enabled -}} +{{- if and (has .Values.datastore.engine (list "postgres" "mysql")) .Values.datastore.applyMigrations -}} apiVersion: batch/v1 kind: Job metadata: diff --git a/charts/openfga/values.schema.json b/charts/openfga/values.schema.json index 4e37b1e..b892b24 100644 --- a/charts/openfga/values.schema.json +++ b/charts/openfga/values.schema.json @@ -88,6 +88,11 @@ "description": "the maximum amount of time (as a duration) a connection to the datastore may be reused", "format": "duration", "examples": ["30s", "1m", "200ms"] + }, + "applyMigrations": { + "type": "boolean", + "description": "enable/disable the job that runs migrations in the datastore", + "default": false } } }, diff --git a/charts/openfga/values.yaml b/charts/openfga/values.yaml index 2343f97..db988d9 100644 --- a/charts/openfga/values.yaml +++ b/charts/openfga/values.yaml @@ -69,6 +69,7 @@ datastore: maxIdleConns: connMaxIdleTime: connMaxLifetime: + applyMigrations: false postgres: ## @param postgres.enabled enable the bitnami/postgresql subchart and deploy Postgres