-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathoperator_test.yaml
More file actions
220 lines (219 loc) · 5.79 KB
/
Copy pathoperator_test.yaml
File metadata and controls
220 lines (219 loc) · 5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
suite: Full Snapshot
templates:
- NOTES.txt
- rbac/*.yaml
- manager/*.yaml
- garage/*.yaml
tests:
- it: matches the snapshot
chart:
version: 0.0.0
appVersion: 0.0.0
set:
imagePullSecrets: [{name: foo}]
customCACertificate.existingCertificate: foo
serviceaccount: {create: true, annotations: {foo: bar}, name: foo}
podSecurityContext: {fsGroup: 1234}
garage:
enabled: true
auth:
accessKey: testaccesskey
secretKey: testsecretkey
rpcSecret: testrpcsecret
adminToken: testadmintoken
asserts:
- matchSnapshot: {}
- it: properly-renders-the-service-monitor-when-enabled
chart:
version: 0.0.0
appVersion: 0.0.0
set:
imagePullSecrets: [{name: foo}]
customCACertificate.existingCertificate: foo
serviceaccount: {create: true, annotations: {foo: bar}, name: foo}
podSecurityContext: {fsGroup: 1234}
metrics:
serviceMonitor:
enabled: true
garage:
enabled: true
auth:
accessKey: testaccesskey
secretKey: testsecretkey
rpcSecret: testrpcsecret
adminToken: testadmintoken
asserts:
- matchSnapshot: {}
- it: renders garage resources when garage is enabled
templates:
- garage/secret.yaml
- garage/service.yaml
- garage/statefulset.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
auth:
accessKey: testaccesskey
secretKey: testsecretkey
asserts:
- hasDocuments:
count: 1
- it: does not render garage resources when garage is disabled
templates:
- garage/secret.yaml
- garage/service.yaml
- garage/statefulset.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: false
asserts:
- hasDocuments:
count: 0
- it: does not render garage resources when legacy minio.enabled is false
templates:
- garage/secret.yaml
- garage/service.yaml
- garage/statefulset.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
minio:
enabled: false
asserts:
- hasDocuments:
count: 0
- it: uses external s3 config when legacy minio.enabled is false
templates:
- manager/manager.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
minio:
enabled: false
s3:
enabled: true
endpoint: my-bucket.s3.amazonaws.com
bucket: my-bucket
authType: access-secret-key
keySecret: my-secret
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
value: "my-bucket.s3.amazonaws.com"
- it: configures manager deployment for garage
templates:
- manager/manager.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_USE_SSL")].value
value: "false"
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
value: "RELEASE-NAME-garage.NAMESPACE.svc.cluster.local"
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_PORT")].value
value: "3900"
- it: allows overriding the cluster domain used for the garage endpoint
templates:
- manager/manager.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
clusterDomain: custom.local
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
value: "RELEASE-NAME-garage.NAMESPACE.svc.custom.local"
- it: configures manager deployment for external s3
templates:
- manager/manager.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: false
s3:
enabled: true
endpoint: "s3.amazonaws.com"
bucket: "my-bucket"
tls:
enabled: true
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_USE_SSL")].value
value: "true"
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
value: "s3.amazonaws.com"
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="S3_BUCKET")].value
value: "my-bucket"
- it: renders garage secret with custom credentials
templates:
- garage/secret.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
auth:
accessKey: customaccesskey
secretKey: customsecretkey
asserts:
- equal:
path: stringData.access-key
value: "customaccesskey"
- equal:
path: stringData.secret-key
value: "customsecretkey"
- it: omits storageClassName when not specified to use default
templates:
- garage/statefulset.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
persistence:
storageClass: ""
asserts:
- notExists:
path: spec.volumeClaimTemplates[0].spec.storageClassName
- it: includes storageClassName when specified
templates:
- garage/statefulset.yaml
chart:
version: 0.0.0
appVersion: 0.0.0
set:
garage:
enabled: true
persistence:
storageClass: "fast-ssd"
asserts:
- equal:
path: spec.volumeClaimTemplates[0].spec.storageClassName
value: "fast-ssd"