Skip to content

Commit 6565006

Browse files
committed
update secrets
1 parent 0d1a9b9 commit 6565006

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

charts/docker-mailserver/templates/deployment.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ spec:
5757
{{- end }}
5858

5959
# Secrets
60-
{{- range .Values.secrets }}
61-
- name: {{ regexReplaceAll "[.]" .name "-" }}
60+
{{- range $name, $secret := .Values.secrets }}
61+
- name: {{ regexReplaceAll "[.]" $name "-" }}
6262
secret:
63-
secretName: {{ regexReplaceAll "[.]" .name "-" }}
63+
secretName: {{ regexReplaceAll "[.]" $name "-" }}
6464
{{- end }}
6565

6666
# Certificate
@@ -144,13 +144,13 @@ spec:
144144
{{- end }}
145145

146146
# Config via Secrets
147-
{{- range .Values.secrets }}
148-
- name: {{ regexReplaceAll "[.]" .name "-" }}
149-
subPath: {{ .key | default .name }}
150-
{{- if isAbs .path }}
151-
mountPath: {{ $.path }}
147+
{{- range $name, $secret := .Values.secrets }}
148+
- name: {{ regexReplaceAll "[.]" $name "-" }}
149+
subPath: {{ $secret.key | default $name }}
150+
{{- if isAbs $secret.path }}
151+
mountPath: {{ $secret.path }}
152152
{{- else }}
153-
mountPath: /tmp/docker-mailserver/{{ .path }}
153+
mountPath: /tmp/docker-mailserver/{{ $secret.path }}
154154
{{- end }}
155155
{{- end }}
156156

charts/docker-mailserver/tests/__snapshot__/deployment_test.yaml.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ manifest should match snapshot:
152152
name: submissions
153153
- containerPort: 587
154154
name: submission
155+
- containerPort: 12525
156+
name: smtp-proxy
155157
- containerPort: 10465
156158
name: subs-proxy
157159
- containerPort: 10587

charts/docker-mailserver/tests/__snapshot__/secret_test.yaml.snap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ manifest should match snapshot:
152152
name: submissions
153153
- containerPort: 587
154154
name: submission
155+
- containerPort: 12525
156+
name: smtp-proxy
155157
- containerPort: 10465
156158
name: subs-proxy
157159
- containerPort: 10587
@@ -243,8 +245,7 @@ manifest should match snapshot:
243245
apiVersion: v1
244246
data:
245247
mailserver-secret.yaml: |
246-
mailserver-username: test
247-
mailserver-password: test
248+
bWFpbHNlcnZlci11c2VybmFtZTogdGVzdAogICAgICAgICAgICBtYWlsc2VydmVyLXBhc3N3b3JkOiB0ZXN0
248249
kind: Secret
249250
metadata:
250251
labels:

charts/docker-mailserver/tests/secret_test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ tests:
1111
- it: manifest should match snapshot
1212
set:
1313
secrets:
14-
- name: mailserver-secret.yaml
14+
mailserver-secret.yaml:
15+
name: mailserver-secret.yaml
1516
create: true
1617
path: secret.yaml
17-
data: |
18-
mailserver-username: test
19-
mailserver-password: test
18+
data: bWFpbHNlcnZlci11c2VybmFtZTogdGVzdAogICAgICAgICAgICBtYWlsc2VydmVyLXBhc3N3b3JkOiB0ZXN0
2019
asserts:
2120
- matchSnapshot: { }

charts/docker-mailserver/values.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -611,15 +611,17 @@ configMaps:
611611
## such as DKIM signing keys.
612612
##
613613
## secrets:
614-
## - name: rspamd.example.com # This is the name of the Secret
615-
## create: true # If true, create a new Secret
616-
## path: rspamd.dkim.rsa-2048-mail-example.com.private.txt
617-
## data: abace # If create is true, then you must specify content. Must be base 64 encoded!
614+
## rspamd.example.com:
615+
## name: rspamd.example.com # This is the name of the Secret
616+
## create: true # If true, create a new Secret
617+
## path: rspamd.dkim.rsa-2048-mail-example.com.private.txt
618+
## data: abace # If create is true, then you must specify content. Must be base 64 encoded!
618619
##
619-
## - name: rspamd.dkim.rsa-2048-mail-example.com.public
620-
## create: true
621-
## path: rspamd/dkim/rsa-2048-mail-example.com.public
622-
## data: abace # If create is true, then you must specify content. Must be base 64 encoded!
620+
## rspamd.dkim.rsa-2048-mail-example.com.public:
621+
## name: rspamd.dkim.rsa-2048-mail-example.com.public
622+
## create: true
623+
## path: rspamd/dkim/rsa-2048-mail-example.com.public
624+
## data: abace # If create is true, then you must specify content. Must be base 64 encoded!
623625
##
624626
## If you set the create key to false, then you must manually create the ConfigMaps before deploying the chart.
625627
##

0 commit comments

Comments
 (0)