Skip to content

Commit c63b424

Browse files
committed
new API to allow services to generate MariaDBAccount
1 parent 376faf4 commit c63b424

22 files changed

+182
-121
lines changed

api/bases/cinder.openstack.org_cinderapis.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -870,12 +870,8 @@ spec:
870870
type: object
871871
passwordSelectors:
872872
default:
873-
database: CinderDatabasePassword
874873
service: CinderPassword
875874
properties:
876-
database:
877-
default: CinderDatabasePassword
878-
type: string
879875
service:
880876
default: CinderPassword
881877
type: string

api/bases/cinder.openstack.org_cinderbackups.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -819,12 +819,8 @@ spec:
819819
type: object
820820
passwordSelectors:
821821
default:
822-
database: CinderDatabasePassword
823822
service: CinderPassword
824823
properties:
825-
database:
826-
default: CinderDatabasePassword
827-
type: string
828824
service:
829825
default: CinderPassword
830826
type: string

api/bases/cinder.openstack.org_cinders.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ spec:
338338
type: object
339339
customServiceConfig:
340340
type: string
341-
databaseInstance:
342-
type: string
343-
databaseUser:
341+
databaseAccount:
344342
default: cinder
345343
type: string
344+
databaseInstance:
345+
type: string
346346
dbPurge:
347347
properties:
348348
age:
@@ -1124,12 +1124,8 @@ spec:
11241124
type: object
11251125
passwordSelectors:
11261126
default:
1127-
database: CinderDatabasePassword
11281127
service: CinderPassword
11291128
properties:
1130-
database:
1131-
default: CinderDatabasePassword
1132-
type: string
11331129
service:
11341130
default: CinderPassword
11351131
type: string

api/bases/cinder.openstack.org_cinderschedulers.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -819,12 +819,8 @@ spec:
819819
type: object
820820
passwordSelectors:
821821
default:
822-
database: CinderDatabasePassword
823822
service: CinderPassword
824823
properties:
825-
database:
826-
default: CinderDatabasePassword
827-
type: string
828824
service:
829825
default: CinderPassword
830826
type: string

api/bases/cinder.openstack.org_cindervolumes.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -819,12 +819,8 @@ spec:
819819
type: object
820820
passwordSelectors:
821821
default:
822-
database: CinderDatabasePassword
823822
service: CinderPassword
824823
properties:
825-
database:
826-
default: CinderDatabasePassword
827-
type: string
828824
service:
829825
default: CinderPassword
830826
type: string

api/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ require (
3737
github.com/modern-go/reflect2 v1.0.2 // indirect
3838
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3939
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
40+
github.com/onsi/gomega v1.31.1 // indirect
4041
github.com/pkg/errors v0.9.1 // indirect
4142
github.com/prometheus/client_golang v1.16.0 // indirect
4243
github.com/prometheus/client_model v0.4.0 // indirect

api/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
7373
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
7474
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
7575
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
76-
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
76+
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
77+
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
7778
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885 h1:o7KZaxKt8Dr97ZJIBPW0P482gLyFEURKF89fizcJCBQ=
7879
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885/go.mod h1:bQwzyQtWCR9F0+IvWZ30J9d1lB6tcX3CNJ0Ten1smDw=
7980
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240216173409-86913e6d5885 h1:sMO+IYsZ91Nho0FV6y03J0NTGd8+ZWB4KmKJJU94gTU=

api/v1beta1/common_types.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ type CinderTemplate struct {
2929

3030
// +kubebuilder:validation:Optional
3131
// +kubebuilder:default=cinder
32-
// DatabaseUser - optional username used for cinder DB, defaults to cinder
33-
// TODO: -> implement needs work in mariadb-operator, right now only cinder
34-
DatabaseUser string `json:"databaseUser"`
32+
// DatabaseAccount - optional MariaDBAccount used for cinder DB, defaults to cinder
33+
DatabaseAccount string `json:"databaseAccount"`
3534

3635
// +kubebuilder:validation:Required
37-
// Secret containing OpenStack password information for CinderDatabasePassword
36+
// Secret containing OpenStack password information
3837
Secret string `json:"secret"`
3938

4039
// +kubebuilder:validation:Optional
41-
// +kubebuilder:default={database: CinderDatabasePassword, service: CinderPassword}
42-
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
40+
// +kubebuilder:default={service: CinderPassword}
41+
// PasswordSelectors - Selectors to identify the ServiceUser password from the Secret
4342
PasswordSelectors PasswordSelector `json:"passwordSelectors"`
4443
}
4544

@@ -79,11 +78,6 @@ type CinderServiceTemplate struct {
7978

8079
// PasswordSelector to identify the DB and AdminUser password from the Secret
8180
type PasswordSelector struct {
82-
// +kubebuilder:validation:Optional
83-
// +kubebuilder:default="CinderDatabasePassword"
84-
// Database - Selector to get the cinder database user password from the Secret
85-
// TODO: not used, need change in mariadb-operator
86-
Database string `json:"database"`
8781
// +kubebuilder:validation:Optional
8882
// +kubebuilder:default="CinderPassword"
8983
// Service - Selector to get the cinder service password from the Secret

config/crd/bases/cinder.openstack.org_cinderapis.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -870,12 +870,8 @@ spec:
870870
type: object
871871
passwordSelectors:
872872
default:
873-
database: CinderDatabasePassword
874873
service: CinderPassword
875874
properties:
876-
database:
877-
default: CinderDatabasePassword
878-
type: string
879875
service:
880876
default: CinderPassword
881877
type: string

config/crd/bases/cinder.openstack.org_cinderbackups.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ spec:
4848
items:
4949
type: string
5050
type: array
51-
databaseHostname:
52-
type: string
53-
databaseUser:
51+
databaseAccount:
5452
default: cinder
5553
type: string
54+
databaseHostname:
55+
type: string
5656
extraMounts:
5757
items:
5858
properties:
@@ -819,12 +819,8 @@ spec:
819819
type: object
820820
passwordSelectors:
821821
default:
822-
database: CinderDatabasePassword
823822
service: CinderPassword
824823
properties:
825-
database:
826-
default: CinderDatabasePassword
827-
type: string
828824
service:
829825
default: CinderPassword
830826
type: string

0 commit comments

Comments
 (0)