@@ -158,3 +158,122 @@ Feature: Support a number of existing operator-backed services out of the box
158
158
hippo
159
159
"""
160
160
And File "/bindings/$scenario_id/password" exists in application pod
161
+
162
+ Scenario : Bind test application to MongoDB provisioned by Percona's MongoDB operator
163
+ Given Crunchy Data Postgres operator is running
164
+ * Generic test application is running
165
+ * The secret is present
166
+ """
167
+ apiVersion: v1
168
+ kind: Secret
169
+ metadata:
170
+ name: my-cluster-name-secrets
171
+ type: Opaque
172
+ stringData:
173
+ MONGODB_BACKUP_USER: backup
174
+ MONGODB_BACKUP_PASSWORD: backup123456
175
+ MONGODB_CLUSTER_ADMIN_USER: clusterAdmin
176
+ MONGODB_CLUSTER_ADMIN_PASSWORD: clusterAdmin123456
177
+ MONGODB_CLUSTER_MONITOR_USER: clusterMonitor
178
+ MONGODB_CLUSTER_MONITOR_PASSWORD: clusterMonitor123456
179
+ MONGODB_USER_ADMIN_USER: userAdmin
180
+ MONGODB_USER_ADMIN_PASSWORD: userAdmin123456
181
+ PMM_SERVER_USER: pmm
182
+ PMM_SERVER_PASSWORD: supa|^|pazz
183
+ """
184
+ * The Custom Resource is present
185
+ """
186
+ apiVersion: psmdb.percona.com
187
+ kind: PerconaServerMongoDB
188
+ metadata:
189
+ name: minimal-cluster
190
+ annotations:
191
+ service.binding/replset: path={.spec.replsets[0].name}
192
+ service.binding/host: path={.status.host}
193
+ service.binding/username: path={.spec.secrets.users},objectType=Secret,sourceKey=MONGODB_USER_ADMIN_USER
194
+ service.binding/password: path={.spec.secrets.users},objectType=Secret,sourceKey=MONGODB_USER_ADMIN_PASSWORD
195
+ spec:
196
+ crVersion: 1.9.0
197
+ image: percona/percona-server-mongodb:4.4.8-9
198
+ allowUnsafeConfigurations: true
199
+ upgradeOptions:
200
+ apply: 4.4-recommended
201
+ schedule: "0 2 * * *"
202
+ secrets:
203
+ users: minimal-cluster-secrets
204
+ replsets:
205
+ - name: rs0
206
+ size: 1
207
+ volumeSpec:
208
+ persistentVolumeClaim:
209
+ resources:
210
+ requests:
211
+ storage: 1Gi
212
+ sharding:
213
+ enabled: false
214
+ """
215
+ When Service Binding is applied
216
+ """
217
+ apiVersion: binding.operators.coreos.com/v1alpha1
218
+ kind: ServiceBinding
219
+ metadata:
220
+ name: $scenario_id
221
+ spec:
222
+ services:
223
+ - group: psmdb.percona.com
224
+ version: v1-10-0
225
+ kind: PerconaServerMongoDB
226
+ name: minimal-cluster
227
+ application:
228
+ name: $scenario_id
229
+ group: apps
230
+ version: v1
231
+ resource: deployments
232
+ """
233
+ Then Service Binding is ready
234
+ And Kind PerconaServerMongoDB with apiVersion psmdb.percona.com/v1-10-0 is listed in bindable kinds
235
+ And Content of file "/bindings/$scenario_id/MONGODB_BACKUP_USER" in application pod is
236
+ """
237
+ backup
238
+ """
239
+ And Content of file "/bindings/$scenario_id/MONGODB_BACKUP_PASSWORD" in application pod is
240
+ """
241
+ backup123456
242
+ """
243
+ And Content of file "/bindings/$scenario_id/MONGODB_CLUSTER_ADMIN_USER" in application pod is
244
+ """
245
+ clusterAdmin
246
+ """
247
+ And Content of file "/bindings/$scenario_id/MONGODB_CLUSTER_ADMIN_PASSWORD" in application pod is
248
+ """
249
+ clusterAdmin123456
250
+ """
251
+ And Content of file "/bindings/$scenario_id/MONGODB_CLUSTER_MONITOR_USER" in application pod is
252
+ """
253
+ clusterMonitor
254
+ """
255
+ And Content of file "/bindings/$scenario_id/MONGODB_CLUSTER_MONITOR_PASSWORD" in application pod is
256
+ """
257
+ clusterMonitor123456
258
+ """
259
+ And Content of file "/bindings/$scenario_id/MONGODB_USER_ADMIN_USER" in application pod is
260
+ """
261
+ userAdmin
262
+ """
263
+ And Content of file "/bindings/$scenario_id/MONGODB_USER_ADMIN_PASSWORD" in application pod is
264
+ """
265
+ userAdmin123456
266
+ """
267
+ And Content of file "/bindings/$scenario_id/PMM_SERVER_USER" in application pod is
268
+ """
269
+ pmm
270
+ """
271
+ And Content of file "/bindings/$scenario_id/PMM_SERVER_PASSWORD" in application pod is
272
+ """
273
+ supa|^|pazz
274
+ """
275
+ And Content of file "/bindings/$scenario_id/replset" in application pod is
276
+ """
277
+ rs0
278
+ """
279
+ And File "/bindings/$scenario_id/host" exists in application pod
0 commit comments