Skip to content

Commit

Permalink
new API to allow services to generate MariaDBAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzeek committed Feb 20, 2024
1 parent 43226b6 commit 6202636
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 103 deletions.
10 changes: 3 additions & 7 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -876,12 +876,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions api/bases/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ spec:
type: object
customServiceConfig:
type: string
databaseInstance:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseInstance:
type: string
dbPurge:
properties:
age:
Expand Down Expand Up @@ -1151,12 +1151,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions api/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions api/bases/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
16 changes: 5 additions & 11 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ type CinderTemplate struct {

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

// +kubebuilder:validation:Required
// Secret containing OpenStack password information for CinderDatabasePassword
// Secret containing OpenStack password information
Secret string `json:"secret"`

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

Expand Down Expand Up @@ -84,11 +83,6 @@ type CinderServiceTemplate struct {

// PasswordSelector to identify the DB and AdminUser password from the Secret
type PasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="CinderDatabasePassword"
// Database - Selector to get the cinder database user password from the Secret
// TODO: not used, need change in mariadb-operator
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="CinderPassword"
// Service - Selector to get the cinder service password from the Secret
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -876,12 +876,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ spec:
type: object
customServiceConfig:
type: string
databaseInstance:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseInstance:
type: string
dbPurge:
properties:
age:
Expand Down Expand Up @@ -1151,12 +1151,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: cinder
type: string
databaseHostname:
type: string
debug:
properties:
service:
Expand Down Expand Up @@ -825,12 +825,8 @@ spec:
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
service: CinderPassword
properties:
database:
default: CinderDatabasePassword
type: string
service:
default: CinderPassword
type: string
Expand Down
2 changes: 1 addition & 1 deletion config/samples/cinder_v1beta1_cinder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
[DEFAULT]
debug = true
databaseInstance: openstack
databaseUser: cinder
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI: {}
cinderScheduler: {}
Expand Down
2 changes: 1 addition & 1 deletion config/samples/cinder_v1beta1_cinder_tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
[DEFAULT]
debug = true
databaseInstance: openstack
databaseUser: cinder
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI:
tls:
Expand Down
Loading

0 comments on commit 6202636

Please sign in to comment.