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 22, 2024
1 parent 0dfc381 commit 447e708
Show file tree
Hide file tree
Showing 36 changed files with 402 additions and 303 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
2 changes: 2 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/onsi/gomega v1.31.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240214144842-5dcac51e5b36 h1:ZSVQYuevQyYZ+bD/x3NLzZx/oVcrsT2tG5agqFzs8fQ=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240214144842-5dcac51e5b36/go.mod h1:bQwzyQtWCR9F0+IvWZ30J9d1lB6tcX3CNJ0Ten1smDw=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
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
Loading

0 comments on commit 447e708

Please sign in to comment.