Skip to content

Commit 2dddc34

Browse files
inelpandzichorsegegunes
authored
K8SPG-634: Auto schema creation (#966)
* Add AutoCreateUserSchema field. * Generate CRDs. * Fix nil pointer. * Update cr.yaml. * Fix CR * Update users e2e test. * Enable autoCreateUserSchema by default. * Enable AutoCreateUserSchema properly. * Fix tests. * Test updated. * Fix panic * Update upgrade-consistency test. --------- Co-authored-by: Viacheslav Sarzhan <[email protected]> Co-authored-by: Ege Güneş <[email protected]>
1 parent 3d7ca1f commit 2dddc34

24 files changed

+64
-315
lines changed

build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ spec:
5656
type: object
5757
spec:
5858
properties:
59+
autoCreateUserSchema:
60+
description: |-
61+
Whether or not the cluster has schemas automatically created for the user
62+
defined in `spec.users` for all of the databases listed for that user.
63+
type: boolean
5964
backups:
6065
description: PostgreSQL backup configuration
6166
properties:

config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ spec:
462462
type: object
463463
spec:
464464
properties:
465+
autoCreateUserSchema:
466+
description: |-
467+
Whether or not the cluster has schemas automatically created for the user
468+
defined in `spec.users` for all of the databases listed for that user.
469+
type: boolean
465470
backups:
466471
description: PostgreSQL backup configuration
467472
properties:

deploy/bundle.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ spec:
755755
type: object
756756
spec:
757757
properties:
758+
autoCreateUserSchema:
759+
description: |-
760+
Whether or not the cluster has schemas automatically created for the user
761+
defined in `spec.users` for all of the databases listed for that user.
762+
type: boolean
758763
backups:
759764
description: PostgreSQL backup configuration
760765
properties:

deploy/cr.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ spec:
2828

2929
# openshift: true
3030

31+
# autoCreateUserSchema: true
32+
3133
# users:
3234
# - name: rhino
3335
# databases:

deploy/crd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ spec:
755755
type: object
756756
spec:
757757
properties:
758+
autoCreateUserSchema:
759+
description: |-
760+
Whether or not the cluster has schemas automatically created for the user
761+
defined in `spec.users` for all of the databases listed for that user.
762+
type: boolean
758763
backups:
759764
description: PostgreSQL backup configuration
760765
properties:

deploy/cw-bundle.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ spec:
755755
type: object
756756
spec:
757757
properties:
758+
autoCreateUserSchema:
759+
description: |-
760+
Whether or not the cluster has schemas automatically created for the user
761+
defined in `spec.users` for all of the databases listed for that user.
762+
type: boolean
758763
backups:
759764
description: PostgreSQL backup configuration
760765
properties:

e2e-tests/tests/upgrade-consistency/01-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ kind: PerconaPGCluster
122122
metadata:
123123
name: upgrade-consistency
124124
spec:
125-
crVersion: 2.1.0
125+
crVersion: 2.4.0
126126
status:
127127
pgbouncer:
128128
ready: 3

e2e-tests/tests/upgrade-consistency/01-create-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ commands:
1010
1111
get_cr \
1212
| yq eval '
13-
.spec.crVersion="2.1.0"' - \
13+
.spec.crVersion="2.4.0"' - \
1414
| kubectl -n "${NAMESPACE}" apply -f -

e2e-tests/tests/upgrade-consistency/02-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ kind: PerconaPGCluster
120120
metadata:
121121
name: upgrade-consistency
122122
spec:
123-
crVersion: 2.2.0
123+
crVersion: 2.5.0
124124
status:
125125
pgbouncer:
126126
ready: 3

e2e-tests/tests/upgrade-consistency/02-patch-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commands:
1010
1111
get_cr \
1212
| yq eval '
13-
.spec.crVersion="2.2.0"' - \
13+
.spec.crVersion="2.5.0"' - \
1414
| kubectl -n "${NAMESPACE}" apply -f -
1515
1616
sleep 10

0 commit comments

Comments
 (0)