Skip to content

Commit

Permalink
migrate from databaseUsername to databaseAccount and fully use MariaD…
Browse files Browse the repository at this point in the history
…BAccount
  • Loading branch information
zzzeek committed Feb 21, 2024
1 parent 0dfc381 commit 006db2d
Show file tree
Hide file tree
Showing 34 changed files with 384 additions and 290 deletions.
17 changes: 5 additions & 12 deletions api/bases/heat.openstack.org_heatapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -254,7 +253,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -264,11 +262,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions api/bases/heat.openstack.org_heatcfnapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -254,7 +253,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -264,11 +262,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions api/bases/heat.openstack.org_heatengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -80,7 +79,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -90,11 +88,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions api/bases/heat.openstack.org_heats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseInstance:
description: MariaDB instance name. Right now required by the maridb-operator
to get the credentials from the instance to create the DB. Might
not be required in future.
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -771,7 +770,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -781,11 +779,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
12 changes: 3 additions & 9 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ type HeatTemplate struct {

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

// +kubebuilder:validation:Required
// Secret containing OpenStack password information for heat HeatDatabasePassword, HeatPassword
// and HeatAuthEncryptionKey
Secret string `json:"secret"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={database: HeatDatabasePassword, service: HeatPassword, authEncryptionKey: HeatAuthEncryptionKey}
// +kubebuilder:default={service: HeatPassword, authEncryptionKey: HeatAuthEncryptionKey}
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
PasswordSelectors PasswordSelector `json:"passwordSelectors"`
}
Expand Down Expand Up @@ -89,11 +88,6 @@ type APIOverrideSpec struct {

// PasswordSelector ..
type PasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="HeatDatabasePassword"
// Database - Selector to get the heat Database user password from the Secret
// TODO: not used, need change in mariadb-operator
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="HeatPassword"
// Service - Selector to get the heat service password from the Secret
Expand Down
17 changes: 5 additions & 12 deletions config/crd/bases/heat.openstack.org_heatapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -254,7 +253,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -264,11 +262,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions config/crd/bases/heat.openstack.org_heatcfnapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -254,7 +253,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -264,11 +262,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions config/crd/bases/heat.openstack.org_heatengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseHostname:
description: DatabaseHostname - Heat Database Hostname
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -80,7 +79,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -90,11 +88,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
17 changes: 5 additions & 12 deletions config/crd/bases/heat.openstack.org_heats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: heat
description: DatabaseAccount - optional MariaDBAccount used for heat
DB, defaults to heat.
type: string
databaseInstance:
description: MariaDB instance name. Right now required by the maridb-operator
to get the credentials from the instance to create the DB. Might
not be required in future.
type: string
databaseUser:
default: heat
description: 'DatabaseUser - optional username used for heat DB, defaults
to heat. TODO: -> implement needs work in mariadb-operator, right
now only heat.'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -771,7 +770,6 @@ spec:
passwordSelectors:
default:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
service: HeatPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
Expand All @@ -781,11 +779,6 @@ spec:
description: AuthEncryptionKey - Selector to get the heat auth
encryption key from the Secret
type: string
database:
default: HeatDatabasePassword
description: 'Database - Selector to get the heat Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: HeatPassword
description: Service - Selector to get the heat service password
Expand Down
4 changes: 4 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ rules:
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
Expand Down
2 changes: 1 addition & 1 deletion config/samples/heat_v1beta1_heatapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: heat-api
spec:
databaseHostname: openstack
databaseUser: heat
databaseAccount: heat
passwordSelectors:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
Expand Down
2 changes: 1 addition & 1 deletion config/samples/heat_v1beta1_heatapicfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: heat-cfnapi
spec:
databaseHostname: openstack
databaseUser: heat
databaseAccount: heat
passwordSelectors:
authEncryptionKey: HeatAuthEncryptionKey
database: HeatDatabasePassword
Expand Down
Loading

0 comments on commit 006db2d

Please sign in to comment.