Skip to content

Commit 77011ab

Browse files
committed
Support loading extra envFrom, fix mongodb password loading when not using existingSecret
1 parent 2146793 commit 77011ab

File tree

8 files changed

+31
-45
lines changed

8 files changed

+31
-45
lines changed

backend/Chart.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
dependencies:
22
- name: common
33
repository: oci://registry-1.docker.io/bitnamicharts
4-
version: 2.22.0
4+
version: 2.24.0
55
- name: mongodb
66
repository: https://charts.bitnami.com/bitnami
7-
version: 15.6.22
7+
version: 15.6.26
88
- name: keycloak
99
repository: https://charts.bitnami.com/bitnami
1010
version: 22.1.2
11-
digest: sha256:d12da76a8e37e2c842d48c0243765f275070a3b7d4876637280594aaa8d3035c
12-
generated: "2024-09-07T22:00:15.851075091+02:00"
11+
digest: sha256:f0924715b75e38bc52785086e8299760d329c171031ab74ef567b6f9d0b92c05
12+
generated: "2024-10-06T14:20:14.977091901+02:00"

backend/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: backend
3-
version: 0.2.0
3+
version: 0.2.1
44
description: Backend of the Snoty application suite
55
type: application
66
home: https://snoty.me
@@ -12,7 +12,7 @@ maintainers:
1212
1313
url: https://github.com/SIMULATAN
1414
icon: https://avatars.githubusercontent.com/u/163506575
15-
appVersion: "0.0.1-133"
15+
appVersion: "0.0.1-176"
1616
dependencies:
1717
- name: common
1818
version: 2.x.x

backend/charts/common-2.22.0.tgz

-15.8 KB
Binary file not shown.

backend/charts/common-2.24.0.tgz

15.9 KB
Binary file not shown.

backend/charts/mongodb-15.6.22.tgz

-92.9 KB
Binary file not shown.

backend/charts/mongodb-15.6.26.tgz

92.9 KB
Binary file not shown.

backend/templates/_config.tpl

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,44 +76,33 @@
7676
{{- end }}
7777

7878
{{- define "snoty.envLoaders" -}}
79-
{{- with $.Values.appConfig }}
80-
{{ if kindIs "map" .database }}
81-
{{- with .database }}
82-
{{ if kindIs "map" .password }}
83-
{{- with .password -}}
84-
- name: database.password
79+
{{ if kindIs "map" .Values.mongodb.auth }}
80+
{{- with .Values.mongodb.auth }}
81+
{{ if .existingSecret }}
82+
- name: mongodb.authentication.password
8583
valueFrom:
8684
secretKeyRef:
87-
name: {{ .secretName }}
88-
key: {{ .secretKey | default "password" }}
85+
name: {{ .existingSecret }}
86+
key: {{ .secretKey | default "mongodb-passwords" }}
8987
{{- end -}}
9088
{{- end -}}
91-
{{ if kindIs "map" .jdbcUrl }}
92-
{{- with .jdbcUrl -}}
93-
- name: database.jdbcUrl
94-
valueFrom:
95-
secretKeyRef:
96-
name: {{ .secretName }}
97-
key: {{ .secretKey | default "jdbcUrl" }}
98-
{{- end -}}
99-
{{- end -}}
100-
{{- end -}}
101-
{{- end -}}
102-
{{- with .authentication -}}
103-
{{ if kindIs "map" .clientId }}
104-
- name: authentication.clientId
105-
valueFrom:
106-
secretKeyRef:
107-
name: {{ .clientId.secretName }}
108-
key: {{ .clientId.secretKey | default "clientId" }}
109-
{{- end -}}
110-
{{ if kindIs "map" .clientSecret }}
111-
- name: authentication.clientSecret
112-
valueFrom:
113-
secretKeyRef:
114-
name: {{ .clientSecret.secretName }}
115-
key: {{ .clientSecret.secretKey | default "clientSecret" }}
11689
{{- end -}}
90+
{{- with $.Values.appConfig }}
91+
{{- with .authentication -}}
92+
{{ if kindIs "map" .clientId }}
93+
- name: authentication.clientId
94+
valueFrom:
95+
secretKeyRef:
96+
name: {{ .clientId.secretName }}
97+
key: {{ .clientId.secretKey | default "clientId" }}
98+
{{- end -}}
99+
{{ if kindIs "map" .clientSecret }}
100+
- name: authentication.clientSecret
101+
valueFrom:
102+
secretKeyRef:
103+
name: {{ .clientSecret.secretName }}
104+
key: {{ .clientSecret.secretKey | default "clientSecret" }}
105+
{{- end -}}
106+
{{- end -}}
117107
{{- end -}}
118108
{{- end -}}
119-
{{- end -}}

backend/templates/deployment.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,15 @@ spec:
3535
{{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" $) | nindent 12 }}
3636
{{- end }}
3737
env:
38-
- name: mongodb.authentication.password
39-
valueFrom:
40-
secretKeyRef:
41-
name: {{ .Values.mongodb.auth.existingSecret }}
42-
key: mongodb-passwords
4338
{{- $envLoaders := include "snoty.envLoaders" . | nindent 8 | trim }}
4439
{{- if $envLoaders }}
4540
{{ $envLoaders }}
4641
{{- end }}
4742
{{- if .Values.extraEnvVars }}
4843
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 10 }}
4944
{{- end }}
45+
envFrom:
46+
{{- .Values.extraEnvFrom | toYaml | nindent 10 }}
5047
volumeMounts:
5148
- mountPath: /app/application.yml
5249
name: app-config

0 commit comments

Comments
 (0)