Skip to content

Commit

Permalink
migrate from databaseUsername to databaseAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzeek committed Feb 19, 2024
1 parent ae7ad70 commit 0a263f2
Show file tree
Hide file tree
Showing 55 changed files with 1,019 additions and 472 deletions.
41 changes: 12 additions & 29 deletions api/bases/nova.openstack.org_nova.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ spec:
spec:
description: NovaSpec defines the desired state of Nova
properties:
apiDatabaseAccount:
default: nova-api
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseInstance:
default: openstack
description: APIDatabaseInstance is the name of the MariaDB CR to
select the DB Service instance used for the Nova API DB.
type: string
apiDatabaseUser:
default: nova_api
description: APIDatabaseUser - username to use when accessing the
API DB
type: string
apiMessageBusInstance:
default: rabbitmq
description: APIMessageBusInstance is the name of the RabbitMqCluster
Expand Down Expand Up @@ -361,16 +361,16 @@ spec:
description: NovaCellTemplate defines the input parameters specified
by the user to create a NovaCell via higher level CRDs.
properties:
cellDatabaseAccount:
description: CellDatabaseAccount - MariaDBAccount to use when
accessing the give cell DB
type: string
cellDatabaseInstance:
default: openstack
description: CellDatabaseInstance is the name of the MariaDB
CR to select the DB Service instance used as the DB of this
cell.
type: string
cellDatabaseUser:
description: CellDatabaseUser - username to use when accessing
the give cell DB
type: string
cellMessageBusInstance:
default: rabbitmq
description: CellMessageBusInstance is the name of the RabbitMqCluster
Expand Down Expand Up @@ -1194,29 +1194,17 @@ spec:
Key from map is arbitrary name for the compute with a limit
of 20 characters.'
type: object
passwordSelectors:
default:
database: NovaCell0DatabasePassword
description: PasswordSelectors - Selectors to identify the DB
passwords from the Secret
properties:
database:
default: NovaCell0DatabasePassword
description: CellDatabase - the name of the field to get
the Cell DB password from the Secret
type: string
type: object
required:
- cellDatabaseUser
- cellDatabaseAccount
- hasAPIAccess
type: object
default:
cell0:
cellDatabaseUser: nova_cell0
cellDatabaseAccount: nova-cell0
hasAPIAccess: true
cell1:
cellDatabaseAccount: nova-cell1
cellDatabaseInstance: openstack-cell1
cellDatabaseUser: nova_cell1
cellMessageBusInstance: rabbitmq-cell1
hasAPIAccess: true
description: Cells is a mapping of cell names to NovaCellTemplate
Expand Down Expand Up @@ -1531,11 +1519,6 @@ spec:
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser passwords from the Secret
properties:
apiDatabase:
default: NovaAPIDatabasePassword
description: APIDatabase - the name of the field to get the API
DB password from the Secret
type: string
metadataSecret:
default: MetadataSecret
description: MetadataSecret - the name of the field to get the
Expand Down
18 changes: 9 additions & 9 deletions api/bases/nova.openstack.org_novaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ spec:
spec:
description: NovaAPISpec defines the desired state of NovaAPI
properties:
apiDatabaseAccount:
default: nova-api
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseHostname:
description: APIDatabaseHostname - hostname to use when accessing
the API DB
type: string
apiDatabaseUser:
default: nova_api
description: APIDatabaseUser - username to use when accessing the
API DB
cell0DatabaseAccount:
default: nova-cell0
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the cell0 DB
type: string
cell0DatabaseHostname:
description: APIDatabaseHostname - hostname to use when accessing
the cell0 DB
type: string
cell0DatabaseUser:
default: nova_cell0
description: APIDatabaseUser - username to use when accessing the
cell0 DB
type: string
containerImage:
description: The service specific Container Image URL (will be set
to environmental default if empty)
Expand Down
16 changes: 8 additions & 8 deletions api/bases/nova.openstack.org_novacells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ spec:
spec:
description: NovaCellSpec defines the desired state of NovaCell
properties:
apiDatabaseAccount:
default: nova
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseHostname:
description: 'APIDatabaseHostname - hostname to use when accessing
the API DB. If not provided then up-calls will be disabled. This
filed is Required for cell0. TODO(gibi): Add a webhook to validate
cell0 constraint'
type: string
apiDatabaseUser:
cellDatabaseAccount:
default: nova
description: APIDatabaseUser - username to use when accessing the
API DB
description: CellDatabaseAccount - MariaDBAccount to use when accessing
the cell DB
type: string
cellDatabaseHostname:
description: CellDatabaseHostname - hostname to use when accessing
the cell DB
type: string
cellDatabaseUser:
default: nova
description: CellDatabaseUser - username to use when accessing the
cell DB
type: string
cellName:
description: CellName is the name of the Nova Cell. The value "cell0"
has a special meaning. The "cell0" Cell cannot have compute nodes
Expand Down
16 changes: 8 additions & 8 deletions api/bases/nova.openstack.org_novaconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ spec:
spec:
description: NovaConductorSpec defines the desired state of NovaConductor
properties:
apiDatabaseAccount:
default: nova
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseHostname:
description: 'APIDatabaseHostname - hostname to use when accessing
the API DB. If not provided then up-calls will be disabled. This
filed is Required for cell0. TODO(gibi): Add a webhook to validate
cell0 constraint'
type: string
apiDatabaseUser:
cellDatabaseAccount:
default: nova
description: APIDatabaseUser - username to use when accessing the
API DB
description: CellDatabaseAccount - MariaDBAccount to use when accessing
the cell DB
type: string
cellDatabaseHostname:
description: 'NOTE(gibi): This should be Required, see notes in KeystoneAuthURL
CellDatabaseHostname - hostname to use when accessing the cell DB'
type: string
cellDatabaseUser:
default: nova
description: CellDatabaseUser - username to use when accessing the
cell DB
type: string
cellName:
description: CellName is the name of the Nova Cell this conductor
belongs to.
Expand Down
18 changes: 9 additions & 9 deletions api/bases/nova.openstack.org_novametadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@ spec:
spec:
description: NovaMetadataSpec defines the desired state of NovaMetadata
properties:
apiDatabaseAccount:
default: nova-api
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseHostname:
description: 'APIDatabaseHostname - hostname to use when accessing
the API DB. This filed is Required if the CellName is not provided
TODO(gibi): Add a webhook to validate the CellName constraint'
type: string
apiDatabaseUser:
default: nova_api
description: APIDatabaseUser - username to use when accessing the
API DB
cellDatabaseAccount:
default: nova
description: CellDatabaseAccount - MariaDBAccount to use when accessing
the cell DB
type: string
cellDatabaseHostname:
description: 'CellDatabaseHostname - hostname to use when accessing
the cell DB This is unused if CellName is not provided. But if it
is provided then CellDatabaseHostName is also Required. TODO(gibi):
add webhook to validate this CellName constraint'
type: string
cellDatabaseUser:
default: nova
description: CellDatabaseUser - username to use when accessing the
cell DB
type: string
cellName:
description: CellName is the name of the Nova Cell this metadata service
belongs to. If not provided then the metadata serving every cells
Expand Down
10 changes: 5 additions & 5 deletions api/bases/nova.openstack.org_novanovncproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ spec:
spec:
description: NovaNoVNCProxySpec defines the desired state of NovaNoVNCProxy
properties:
cellDatabaseAccount:
default: nova
description: CellDatabaseAccount - MariaDBAccount to use when accessing
the cell DB
type: string
cellDatabaseHostname:
description: CellDatabaseHostname - hostname to use when accessing
the cell DB
type: string
cellDatabaseUser:
default: nova
description: CellDatabaseUser - username to use when accessing the
cell DB
type: string
cellName:
description: CellName is the name of the Nova Cell this novncproxy
belongs to.
Expand Down
18 changes: 9 additions & 9 deletions api/bases/nova.openstack.org_novaschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ spec:
spec:
description: NovaSchedulerSpec defines the desired state of NovaScheduler
properties:
apiDatabaseAccount:
default: nova-api
description: APIDatabaseAccount - MariaDBAccount to use when accessing
the API DB
type: string
apiDatabaseHostname:
description: APIDatabaseHostname - hostname to use when accessing
the API DB
type: string
apiDatabaseUser:
default: nova_api
description: APIDatabaseUser - username to use when accessing the
API DB
cell0DatabaseAccount:
default: nova-cell0
description: Cell0DatabaseAccount - MariaDBAccount to use when accessing
the cell0 DB
type: string
cell0DatabaseHostname:
description: Cell0DatabaseHostname - hostname to use when accessing
the cell0 DB
type: string
cell0DatabaseUser:
default: nova_cell0
description: Cell0DatabaseUser - username to use when accessing the
cell0 DB
type: string
containerImage:
description: The service specific Container Image URL (will be set
to environmental default if empty)
Expand Down
14 changes: 0 additions & 14 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,12 @@ type PasswordSelector struct {
// Secret
Service string `json:"service"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="NovaAPIDatabasePassword"
// APIDatabase - the name of the field to get the API DB password from the
// Secret
APIDatabase string `json:"apiDatabase"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="MetadataSecret"
// MetadataSecret - the name of the field to get the metadata secret from the
// Secret
MetadataSecret string `json:"metadataSecret"`
}

// PasswordSelector to identify the DB password for the Cell from the Secret
type CellPasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="NovaCell0DatabasePassword"
// CellDatabase - the name of the field to get the Cell DB password from
// the Secret
Database string `json:"database"`
}

// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
func SetupDefaults() {
// Acquire environmental defaults and initialize Nova defaults with them
Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/nova_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type NovaSpec struct {
APIMessageBusInstance string `json:"apiMessageBusInstance"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={cell0: {cellDatabaseUser: nova_cell0, hasAPIAccess: true}, cell1: {cellDatabaseUser: nova_cell1, cellDatabaseInstance: openstack-cell1, cellMessageBusInstance: rabbitmq-cell1, hasAPIAccess: true}}
// +kubebuilder:default={cell0: {cellDatabaseAccount: nova-cell0, hasAPIAccess: true}, cell1: {cellDatabaseAccount: nova-cell1, cellDatabaseInstance: openstack-cell1, cellMessageBusInstance: rabbitmq-cell1, hasAPIAccess: true}}
// Cells is a mapping of cell names to NovaCellTemplate objects defining
// the cells in the deployment. The "cell0" cell is a mandatory cell in
// every deployment. Moreover any real deployment needs at least one
Expand All @@ -62,9 +62,9 @@ type NovaSpec struct {
ServiceUser string `json:"serviceUser"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="nova_api"
// APIDatabaseUser - username to use when accessing the API DB
APIDatabaseUser string `json:"apiDatabaseUser"`
// +kubebuilder:default="nova-api"
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
APIDatabaseAccount string `json:"apiDatabaseAccount"`

// +kubebuilder:validation:Required
// Secret is the name of the Secret instance containing password
Expand Down
12 changes: 6 additions & 6 deletions api/v1beta1/novaapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ type NovaAPISpec struct {
KeystonePublicAuthURL string `json:"keystonePublicAuthURL"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="nova_api"
// APIDatabaseUser - username to use when accessing the API DB
APIDatabaseUser string `json:"apiDatabaseUser"`
// +kubebuilder:default="nova-api"
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
APIDatabaseAccount string `json:"apiDatabaseAccount"`

// +kubebuilder:validation:Required
// APIDatabaseHostname - hostname to use when accessing the API DB
APIDatabaseHostname string `json:"apiDatabaseHostname"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="nova_cell0"
// APIDatabaseUser - username to use when accessing the cell0 DB
Cell0DatabaseUser string `json:"cell0DatabaseUser"`
// +kubebuilder:default="nova-cell0"
// APIDatabaseAccount - MariaDBAccount to use when accessing the cell0 DB
Cell0DatabaseAccount string `json:"cell0DatabaseAccount"`

// +kubebuilder:validation:Required
// APIDatabaseHostname - hostname to use when accessing the cell0 DB
Expand Down
Loading

0 comments on commit 0a263f2

Please sign in to comment.