Skip to content

Commit 3a5f18a

Browse files
committed
fix(email): express the storage route as guarded patch operations
1 parent 4d3ba9d commit 3a5f18a

2 files changed

Lines changed: 57 additions & 37 deletions

File tree

‎k8s/providers/hetzner/apps/private-mail/kustomization.yaml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ patches:
4646
patch: |-
4747
- op: remove
4848
path: /metadata/labels/platform.devantler.tech~1storage-stage
49-
- path: patches/route-serving-storage.yaml
49+
- target:
50+
group: apps
51+
version: v1
52+
kind: StatefulSet
53+
name: private-mail
54+
namespace: private-mail
55+
path: patches/route-serving-storage.yaml
5056
- target:
5157
group: apps
5258
version: v1
Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
1-
apiVersion: apps/v1
2-
kind: StatefulSet
3-
metadata:
4-
name: private-mail
5-
namespace: private-mail
6-
spec:
7-
template:
8-
spec:
9-
initContainers:
10-
- name: configure
11-
volumeMounts:
12-
- name: serving-storage
13-
mountPath: /etc/stalwart/config.json
14-
subPath: config.json
15-
readOnly: true
16-
- name: v2-data
17-
mountPath: /var/lib/stalwart-v2
18-
containers:
19-
- name: private-mail
20-
volumeMounts:
21-
- name: serving-storage
22-
mountPath: /etc/stalwart/config.json
23-
subPath: config.json
24-
readOnly: true
25-
- name: v2-data
26-
mountPath: /var/lib/stalwart-v2
27-
volumes:
28-
- name: legacy-data
29-
$patch: delete
30-
- name: serving-storage
31-
emptyDir:
32-
medium: Memory
33-
sizeLimit: 1Mi
34-
- name: v2-data
35-
persistentVolumeClaim:
36-
claimName: email-data-encrypted-v2
1+
# Keep the selected config mount, and both encrypted stores, on setup and serving.
2+
- op: test
3+
path: /spec/template/spec/initContainers/0/name
4+
value: configure
5+
- op: test
6+
path: /spec/template/spec/containers/1/name
7+
value: private-mail
8+
- op: move
9+
from: /spec/template/spec/containers/1
10+
path: /spec/template/spec/containers/0
11+
- op: test
12+
path: /spec/template/spec/initContainers/0/volumeMounts/0/name
13+
value: datastore
14+
- op: test
15+
path: /spec/template/spec/containers/0/volumeMounts/0/name
16+
value: datastore
17+
- op: replace
18+
path: /spec/template/spec/initContainers/0/volumeMounts/0/name
19+
value: serving-storage
20+
- op: replace
21+
path: /spec/template/spec/containers/0/volumeMounts/0/name
22+
value: serving-storage
23+
- op: add
24+
path: /spec/template/spec/initContainers/0/volumeMounts/1
25+
value:
26+
name: v2-data
27+
mountPath: /var/lib/stalwart-v2
28+
- op: add
29+
path: /spec/template/spec/containers/0/volumeMounts/1
30+
value:
31+
name: v2-data
32+
mountPath: /var/lib/stalwart-v2
33+
- op: test
34+
path: /spec/template/spec/volumes/1/name
35+
value: legacy-data
36+
- op: remove
37+
path: /spec/template/spec/volumes/1
38+
- op: add
39+
path: /spec/template/spec/volumes/0
40+
value:
41+
name: serving-storage
42+
emptyDir:
43+
medium: Memory
44+
sizeLimit: 1Mi
45+
- op: add
46+
path: /spec/template/spec/volumes/1
47+
value:
48+
name: v2-data
49+
persistentVolumeClaim:
50+
claimName: email-data-encrypted-v2

0 commit comments

Comments
 (0)