Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit 5fada86

Browse files
authored
Fix Percona XtraDB Cluster (mysql) annotations (#1105)
Signed-off-by: Pavel Macík <[email protected]>
1 parent f97bd68 commit 5fada86

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

pkg/binding/registry/registry.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,28 @@ func New() Registry {
3131
},
3232
schema.GroupVersionKind{Group: "pxc.percona.com", Version: "v1-8-0", Kind: "PerconaXtraDBCluster"}: {
3333
"service.binding/type": "mysql",
34+
"service.binding/database": "mysql",
3435
"service.binding": "path={.spec.secretsName},objectType=Secret",
35-
"service.binding/host": "path={.status.host}",
36+
"service.binding/host": "path={.status.host}.svc",
37+
"service.binding/port": "3306",
3638
"service.binding/username": "root",
3739
"service.binding/password": "path={.spec.secretsName},objectType=Secret,sourceKey=root",
3840
},
3941
schema.GroupVersionKind{Group: "pxc.percona.com", Version: "v1-9-0", Kind: "PerconaXtraDBCluster"}: {
4042
"service.binding/type": "mysql",
43+
"service.binding/database": "mysql",
4144
"service.binding": "path={.spec.secretsName},objectType=Secret",
42-
"service.binding/host": "path={.status.host}",
45+
"service.binding/host": "path={.status.host}.svc",
46+
"service.binding/port": "3306",
47+
"service.binding/username": "root",
48+
"service.binding/password": "path={.spec.secretsName},objectType=Secret,sourceKey=root",
49+
},
50+
schema.GroupVersionKind{Group: "pxc.percona.com", Version: "v1-10-0", Kind: "PerconaXtraDBCluster"}: {
51+
"service.binding/type": "mysql",
52+
"service.binding/database": "mysql",
53+
"service.binding": "path={.spec.secretsName},objectType=Secret",
54+
"service.binding/host": "path={.status.host}.svc",
55+
"service.binding/port": "3306",
4356
"service.binding/username": "root",
4457
"service.binding/password": "path={.spec.secretsName},objectType=Secret,sourceKey=root",
4558
},

test/acceptance/features/supportExistingOperatorBackedServices.feature

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,17 @@ Feature: Support a number of existing operator-backed services out of the box
169169
And Application can connect to the projected Postgres database
170170

171171

172-
@crdv1beta1
173172
Scenario: Bind test application to Mysql provisioned by Percona Mysql operator
174173
Given Percona Mysql operator is running
175174
* Generic test application is running
176175
* The Custom Resource is present
177176
"""
178-
apiVersion: pxc.percona.com/v1-8-0
177+
apiVersion: pxc.percona.com/v1-10-0
179178
kind: PerconaXtraDBCluster
180179
metadata:
181180
name: minimal-cluster
182181
spec:
183-
crVersion: 1.8.0
182+
crVersion: 1.10.0
184183
secretsName: minimal-cluster-secrets
185184
allowUnsafeConfigurations: true
186185
upgradeOptions:
@@ -226,9 +225,17 @@ Feature: Support a number of existing operator-backed services out of the box
226225
"""
227226
mysql
228227
"""
228+
And Content of file "/bindings/$scenario_id/database" in application pod is
229+
"""
230+
mysql
231+
"""|
229232
And Content of file "/bindings/$scenario_id/host" in application pod is
230233
"""
231-
minimal-cluster-haproxy.$NAMESPACE
234+
minimal-cluster-haproxy.$NAMESPACE.svc
235+
"""
236+
And Content of file "/bindings/$scenario_id/port" in application pod is
237+
"""
238+
3306
232239
"""
233240
And Content of file "/bindings/$scenario_id/username" in application pod is
234241
"""

0 commit comments

Comments
 (0)