Skip to content
Merged
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sources:
- https://github.com/appsmithorg/appsmith
home: https://www.appsmith.com/
icon: https://assets.appsmith.com/appsmith-icon.png
version: 3.9.0
version: 3.9.1
dependencies:
- condition: redis.enabled
name: redis
Expand Down
7 changes: 6 additions & 1 deletion deploy/helm/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ data:

{{- range $key, $value := .Values.applicationConfig }}
{{- if and (eq "APPSMITH_KEYCLOAK_DB_DRIVER" $key) ( not $value) }}
{{ $key }}: {{ $.Values.postgresql.enabled | ternary "postgresql" "h2" | quote }}
{{- /* A user-supplied Keycloak DB URL implies PostgreSQL even when the bundled subchart is disabled (external database).
With no PostgreSQL signal at all, omit the key entirely so the container entrypoint can infer the driver at
runtime — the URL may arrive through a Secret (secretName/secrets/externalSecrets) this template cannot see. */}}
{{- if or $.Values.postgresql.enabled (not (empty $.Values.applicationConfig.APPSMITH_KEYCLOAK_DB_URL)) }}
{{ $key }}: "postgresql"
{{- end }}
{{- end }}

{{- if and (eq "APPSMITH_KEYCLOAK_DB_URL" $key) ( not $value) }}
Expand Down
20 changes: 10 additions & 10 deletions deploy/helm/tests/__snapshot__/defaults_snapshot_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
3: |
Expand All @@ -35,7 +35,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -154,7 +154,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith-headless
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -185,7 +185,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith-redis-password-init
namespace: NAMESPACE
6: |
Expand All @@ -200,7 +200,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith-redis-password-init
namespace: NAMESPACE
rules:
Expand Down Expand Up @@ -230,7 +230,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith-redis-password-init
namespace: NAMESPACE
roleRef:
Expand All @@ -253,7 +253,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith-redis-password-init
namespace: NAMESPACE
spec:
Expand All @@ -264,7 +264,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
spec:
containers:
- command:
Expand Down Expand Up @@ -317,7 +317,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
spec:
Expand All @@ -338,7 +338,7 @@
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: appsmith
appsmith.sh/chart: appsmith-3.9.0
appsmith.sh/chart: appsmith-3.9.1
name: RELEASE-NAME-appsmith
namespace: NAMESPACE
secrets:
Expand Down
48 changes: 48 additions & 0 deletions deploy/helm/tests/keycloak_db_driver_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Tests for the APPSMITH_KEYCLOAK_DB_DRIVER default in configMap.yaml.
#
# The driver defaults to "postgresql" when the bundled subchart is enabled OR
# when the user supplies an external APPSMITH_KEYCLOAK_DB_URL. With no
# PostgreSQL signal at all the key is omitted so the container entrypoint can
# infer the driver at runtime (the URL may arrive through a Secret this
# template cannot see). An explicitly set driver is always honored.

suite: Keycloak DB driver default
templates:
- configMap.yaml
tests:
- name: bundled subchart enabled (defaults) resolves driver to postgresql
asserts:
- equal:
path: data.APPSMITH_KEYCLOAK_DB_DRIVER
value: postgresql

- name: external URL with subchart disabled resolves driver to postgresql
set:
postgresql:
enabled: false
applicationConfig:
APPSMITH_KEYCLOAK_DB_URL: "postgresql://user:pass@external-host:5432/keycloak"
asserts:
- equal:
path: data.APPSMITH_KEYCLOAK_DB_DRIVER
value: postgresql

- name: no URL and subchart disabled omits the key (runtime decides)
set:
postgresql:
enabled: false
asserts:
- notExists:
path: data.APPSMITH_KEYCLOAK_DB_DRIVER

- name: explicitly set driver is honored unchanged
set:
postgresql:
enabled: false
applicationConfig:
APPSMITH_KEYCLOAK_DB_DRIVER: postgresql
APPSMITH_KEYCLOAK_DB_URL: "postgresql://user:pass@external-host:5432/keycloak"
asserts:
- equal:
path: data.APPSMITH_KEYCLOAK_DB_DRIVER
value: postgresql
Loading