Skip to content

Commit

Permalink
add DatabaseAccount and migrate to MariaDBAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzeek committed Mar 11, 2024
1 parent 49ad594 commit c69d5ba
Show file tree
Hide file tree
Showing 47 changed files with 803 additions and 291 deletions.
13 changes: 6 additions & 7 deletions api/bases/ironic.openstack.org_ironicapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: ironic
description: DatabaseAccount - optional MariaDBAccount used for ironic
DB, defaults to ironic.
type: string
databaseHostname:
description: DatabaseHostname - Ironic Database Hostname
type: string
Expand Down Expand Up @@ -269,16 +274,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicDatabasePassword
service: IronicPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
properties:
database:
default: IronicDatabasePassword
description: 'Database - Selector to get the ironic Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: IronicPassword
description: Service - Selector to get the ironic service password
Expand Down Expand Up @@ -353,7 +352,7 @@ spec:
type: string
secret:
description: Secret containing OpenStack password information for
IronicDatabasePassword, AdminPassword
AdminPassword
type: string
serviceUser:
default: ironic
Expand Down
17 changes: 8 additions & 9 deletions api/bases/ironic.openstack.org_ironicconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: ironic
description: DatabaseAccount - optional MariaDBAccount used for ironic
DB, defaults to ironic.
type: string
databaseHostname:
description: DatabaseHostname - Ironic Database Hostname
type: string
Expand Down Expand Up @@ -137,16 +142,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicDatabasePassword
service: IronicPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: IronicDatabasePassword
description: 'Database - Selector to get the ironic Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: IronicPassword
description: Service - Selector to get the ironic service password
Expand Down Expand Up @@ -228,7 +227,7 @@ spec:
type: string
secret:
description: Secret containing OpenStack password information for
IronicDatabasePassword, AdminPassword
AdminPassword
type: string
serviceUser:
default: ironic
Expand Down
21 changes: 11 additions & 10 deletions api/bases/ironic.openstack.org_ironicinspectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: ironic-inspector
description: DatabaseAccount - optional MariaDBAccount used for ironic
DB, defaults to ironic-inspector. this is separate from the account
used for ironic, as a MariaDBAccount can only refer to a single
MariaDBDatabase and it appears that ironic inspector uses its own
MariaDBDatabase.
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
Expand Down Expand Up @@ -304,17 +312,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicInspectorDatabasePassword
service: IronicInspectorPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: IronicInspectorDatabasePassword
description: 'Database - Selector to get the ironic-inspector
Database user password from the Secret TODO: not used, need
change in mariadb-operator'
type: string
service:
default: IronicInspectorPassword
description: Service - Selector to get the ironic-inspector service
Expand Down Expand Up @@ -403,7 +404,7 @@ spec:
type: string
secret:
description: Secret containing OpenStack password information for
IronicInspectorDatabasePassword, AdminPassword
AdminPassword
type: string
serviceUser:
default: ironic-inspector
Expand Down
5 changes: 0 additions & 5 deletions api/bases/ironic.openstack.org_ironicneutronagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ spec:
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: IronicDatabasePassword
description: 'Database - Selector to get the ironic Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: IronicPassword
description: Service - Selector to get the ironic service password
Expand Down
32 changes: 16 additions & 16 deletions api/bases/ironic.openstack.org_ironics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: ironic
description: DatabaseAccount - optional MariaDBAccount used for ironic
DB, defaults to ironic.
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
Expand Down Expand Up @@ -546,6 +551,14 @@ spec:
content gets added to to /etc/<service>/<service>.conf.d directory
as custom.conf file.
type: string
databaseAccount:
default: ironic-inspector
description: DatabaseAccount - optional MariaDBAccount used for
ironic DB, defaults to ironic-inspector. this is separate from
the account used for ironic, as a MariaDBAccount can only refer
to a single MariaDBDatabase and it appears that ironic inspector
uses its own MariaDBDatabase.
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -790,17 +803,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicInspectorDatabasePassword
service: IronicInspectorPassword
description: PasswordSelectors - Selectors to identify the DB
and ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: IronicInspectorDatabasePassword
description: 'Database - Selector to get the ironic-inspector
Database user password from the Secret TODO: not used, need
change in mariadb-operator'
type: string
service:
default: IronicInspectorPassword
description: Service - Selector to get the ironic-inspector
Expand Down Expand Up @@ -1007,16 +1013,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicDatabasePassword
service: IronicPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
properties:
database:
default: IronicDatabasePassword
description: 'Database - Selector to get the ironic Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: IronicPassword
description: Service - Selector to get the ironic service password
Expand Down Expand Up @@ -1046,7 +1046,7 @@ spec:
type: string
secret:
description: Secret containing OpenStack password information for
ironic IronicDatabasePassword, IronicPassword
ironic IronicPassword
type: string
serviceUser:
default: ironic
Expand Down
7 changes: 1 addition & 6 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ type IronicServiceTemplate struct {
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`
}

// PasswordSelector to identify the DB and AdminUser password from the Secret
// PasswordSelector to identify the AdminUser password from the Secret
type PasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="IronicDatabasePassword"
// Database - Selector to get the ironic Database user password from the Secret
// TODO: not used, need change in mariadb-operator
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="IronicPassword"
// Service - Selector to get the ironic service password from the Secret
Expand Down
9 changes: 7 additions & 2 deletions api/v1beta1/ironic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,17 @@ type IronicSpecCore struct {
// Might not be required in future.
DatabaseInstance string `json:"databaseInstance"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=ironic
// DatabaseAccount - optional MariaDBAccount used for ironic DB, defaults to ironic.
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Required
// Secret containing OpenStack password information for ironic IronicDatabasePassword, IronicPassword
// Secret containing OpenStack password information for ironic IronicPassword
Secret string `json:"secret"`

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

Expand Down
9 changes: 7 additions & 2 deletions api/v1beta1/ironicapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,23 @@ type IronicAPISpec struct {
ServiceUser string `json:"serviceUser"`

// +kubebuilder:validation:Optional
// Secret containing OpenStack password information for IronicDatabasePassword, AdminPassword
// Secret containing OpenStack password information for AdminPassword
Secret string `json:"secret,omitempty"`

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

// +kubebuilder:validation:Required
// DatabaseHostname - Ironic Database Hostname
DatabaseHostname string `json:"databaseHostname"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=ironic
// DatabaseAccount - optional MariaDBAccount used for ironic DB, defaults to ironic.
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Optional
// Secret containing RabbitMq transport URL
TransportURLSecret string `json:"transportURLSecret,omitempty"`
Expand Down
11 changes: 8 additions & 3 deletions api/v1beta1/ironicconductor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,23 @@ type IronicConductorSpec struct {
ServiceUser string `json:"serviceUser"`

// +kubebuilder:validation:Optional
// Secret containing OpenStack password information for IronicDatabasePassword, AdminPassword
// Secret containing OpenStack password information for AdminPassword
Secret string `json:"secret,omitempty"`

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

// +kubebuilder:validation:Required
// DatabaseHostname - Ironic Database Hostname
DatabaseHostname string `json:"databaseHostname"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=ironic
// DatabaseAccount - optional MariaDBAccount used for ironic DB, defaults to ironic.
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Optional
// TransportURLSecret - Secret containing RabbitMQ transportURL
TransportURLSecret string `json:"transportURLSecret,omitempty"`
Expand Down
21 changes: 12 additions & 9 deletions api/v1beta1/ironicinspector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// IronicInspectorPasswordSelector to identify the DB and AdminUser password from the Secret
// IronicInspectorPasswordSelector to identify the AdminUser password from the Secret
type IronicInspectorPasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="IronicInspectorDatabasePassword"
// Database - Selector to get the ironic-inspector Database user password from the Secret
// TODO: not used, need change in mariadb-operator
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="IronicInspectorPassword"
// Service - Selector to get the ironic-inspector service password from the Secret
Expand All @@ -52,8 +47,16 @@ type IronicInspectorTemplate struct {
Replicas *int32 `json:"replicas"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={database: IronicInspectorDatabasePassword, service: IronicInspectorPassword}
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
// +kubebuilder:default=ironic-inspector
// DatabaseAccount - optional MariaDBAccount used for ironic DB, defaults to ironic-inspector.
// this is separate from the account used for ironic, as a MariaDBAccount can only
// refer to a single MariaDBDatabase and it appears that ironic inspector uses its
// own MariaDBDatabase.
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={service: IronicInspectorPassword}
// PasswordSelectors - Selectors to identify the ServiceUser password from the Secret
PasswordSelectors IronicInspectorPasswordSelector `json:"passwordSelectors"`

// +kubebuilder:validation:Optional
Expand Down Expand Up @@ -146,7 +149,7 @@ type IronicInspectorSpec struct {
DatabaseInstance string `json:"databaseInstance"`

// +kubebuilder:validation:Optional
// Secret containing OpenStack password information for IronicInspectorDatabasePassword, AdminPassword
// Secret containing OpenStack password information for AdminPassword
Secret string `json:"secret,omitempty"`

// +kubebuilder:validation:Optional
Expand Down
13 changes: 6 additions & 7 deletions config/crd/bases/ironic.openstack.org_ironicapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: ironic
description: DatabaseAccount - optional MariaDBAccount used for ironic
DB, defaults to ironic.
type: string
databaseHostname:
description: DatabaseHostname - Ironic Database Hostname
type: string
Expand Down Expand Up @@ -269,16 +274,10 @@ spec:
type: object
passwordSelectors:
default:
database: IronicDatabasePassword
service: IronicPassword
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
properties:
database:
default: IronicDatabasePassword
description: 'Database - Selector to get the ironic Database user
password from the Secret TODO: not used, need change in mariadb-operator'
type: string
service:
default: IronicPassword
description: Service - Selector to get the ironic service password
Expand Down Expand Up @@ -353,7 +352,7 @@ spec:
type: string
secret:
description: Secret containing OpenStack password information for
IronicDatabasePassword, AdminPassword
AdminPassword
type: string
serviceUser:
default: ironic
Expand Down
Loading

0 comments on commit c69d5ba

Please sign in to comment.