Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove "mariadb" CRD references in favor of Galera #597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3512,7 +3512,7 @@ spec:
galera:
properties:
enabled:
default: false
default: true
type: boolean
templates:
additionalProperties:
Expand Down Expand Up @@ -7613,35 +7613,6 @@ spec:
- rabbitMqClusterName
type: object
type: object
mariadb:
properties:
enabled:
default: true
type: boolean
templates:
additionalProperties:
properties:
adoptionRedirect:
properties:
host:
type: string
type: object
containerImage:
type: string
secret:
type: string
storageClass:
type: string
storageRequest:
type: string
required:
- containerImage
- secret
- storageClass
- storageRequest
type: object
type: object
type: object
memcached:
properties:
enabled:
Expand Down
21 changes: 1 addition & 20 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ type OpenStackControlPlaneSpec struct {
// Cinder - Parameters related to the Cinder service
Cinder CinderSection `json:"cinder,omitempty"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Mariadb - Parameters related to the Mariadb service
Mariadb MariadbSection `json:"mariadb,omitempty"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Galera - Parameters related to the Galera services
Expand Down Expand Up @@ -324,24 +319,10 @@ type CinderSection struct {
APIOverride Override `json:"apiOverride,omitempty"`
}

// MariadbSection defines the desired state of MariaDB service
type MariadbSection struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=true
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// Enabled - Whether MariaDB service should be deployed and managed
Enabled bool `json:"enabled"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Templates - Overrides to use when creating the MariaDB databases
Templates map[string]mariadbv1.MariaDBSpec `json:"templates,omitempty"`
}

// GaleraSection defines the desired state of Galera services
type GaleraSection struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// +kubebuilder:default=true
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// Enabled - Whether Galera services should be deployed and managed
Enabled bool `json:"enabled"`
Expand Down
59 changes: 20 additions & 39 deletions apis/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,55 +116,55 @@ func (r *OpenStackControlPlane) checkDepsEnabled(name string) string {

switch name {
case "Keystone":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled) {
reqs = "MariaDB or Galera, Memcached"
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled) {
reqs = "Galera, Memcached"
}
case "Glance":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "Galera, Memcached, Keystone"
}
case "Cinder":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone"
reqs = "Galera, Memcached, RabbitMQ, Keystone"
}
case "Placement":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "Galera, Memcached, Keystone"
}
case "Neutron":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, RabbitMQ, Keystone"
reqs = "Galera, RabbitMQ, Keystone"
}
case "Nova":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled && r.Spec.Placement.Enabled && r.Spec.Neutron.Enabled && r.Spec.Glance.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone, Glance Neutron, Placement"
reqs = "Galera, Memcached, RabbitMQ, Keystone, Glance Neutron, Placement"
}
case "Heat":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone"
reqs = "Galera, Memcached, RabbitMQ, Keystone"
}
case "Swift":
if !(r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "Memcached, Keystone"
}
case "Horizon":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "Galera, Memcached, Keystone"
}
case "Barbican":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone"
if !((r.Spec.Galera.Enabled) && r.Spec.Keystone.Enabled) {
reqs = "Galera, Keystone"
}
case "Octavia":
// TODO(beagles): So far we haven't declared Redis as dependency for Octavia, but we might.
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
if !((r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled && r.Spec.Neutron.Enabled && r.Spec.Glance.Enabled && r.Spec.Nova.Enabled &&
r.Spec.Ovn.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone, Glance, Neutron, Nova, OVN"
reqs = "Galera, Memcached, RabbitMQ, Keystone, Glance, Neutron, Nova, OVN"
}
}

Expand Down Expand Up @@ -217,12 +217,6 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
func (r *OpenStackControlPlane) ValidateServiceDependencies(basePath *field.Path) field.ErrorList {
var allErrs field.ErrorList

// Temporary check until MariaDB is deprecated
if r.Spec.Mariadb.Enabled && r.Spec.Galera.Enabled {
err := field.Invalid(basePath.Child("mariaDB").Child("enabled"), r.Spec.Mariadb.Enabled, "Mariadb and Galera are mutually exclusive")
allErrs = append(allErrs, err)
}

// Add service dependency validations

if r.Spec.Keystone.Enabled {
Expand Down Expand Up @@ -370,19 +364,6 @@ func (r *OpenStackControlPlane) DefaultServices() {
// Manila
r.Spec.Manila.Template.Default()

// MariaDB
for key, template := range r.Spec.Mariadb.Templates {
if template.StorageClass == "" {
template.StorageClass = r.Spec.StorageClass
}
if template.Secret == "" {
template.Secret = r.Spec.Secret
}
template.Default()
// By-value copy, need to update
r.Spec.Mariadb.Templates[key] = template
}

// Memcached
for key, template := range r.Spec.Memcached.Templates {
template.Default()
Expand Down
23 changes: 0 additions & 23 deletions apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 1 addition & 30 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3512,7 +3512,7 @@ spec:
galera:
properties:
enabled:
default: false
default: true
type: boolean
templates:
additionalProperties:
Expand Down Expand Up @@ -7613,35 +7613,6 @@ spec:
- rabbitMqClusterName
type: object
type: object
mariadb:
properties:
enabled:
default: true
type: boolean
templates:
additionalProperties:
properties:
adoptionRedirect:
properties:
host:
type: string
type: object
containerImage:
type: string
secret:
type: string
storageClass:
type: string
storageRequest:
type: string
required:
- containerImage
- secret
- storageClass
- storageRequest
type: object
type: object
type: object
memcached:
properties:
enabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ spec:
- description: Template - Overrides to use when creating the Barbican Service
displayName: Template
path: barbican.template
- description: Enabled - Whether OpenStack Ceilometer servicesshould be deployed
and managed
displayName: Enabled
path: ceilometer.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Template - Overrides to use when creating the OpenStack Ceilometer
service
displayName: Template
path: ceilometer.template
- description: Cinder - Parameters related to the Cinder service
displayName: Cinder
path: cinder
Expand Down Expand Up @@ -221,17 +211,6 @@ spec:
path: manila.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mariadb - Parameters related to the Mariadb service
displayName: Mariadb
path: mariadb
- description: Enabled - Whether MariaDB service should be deployed and managed
displayName: Enabled
path: mariadb.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Templates - Overrides to use when creating the MariaDB databases
displayName: Templates
path: mariadb.templates
- description: Memcached - Parameters related to the Memcached service
displayName: Memcached
path: memcached
Expand Down Expand Up @@ -399,6 +378,16 @@ spec:
- description: Template - Overrides to use when creating Swift Resources
displayName: Template
path: swift.template
- description: Enabled - Whether OpenStack Telemetry services should be deployed
and managed
displayName: Enabled
path: telemetry.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Template - Overrides to use when creating the OpenStack Telemetry
services
displayName: Template
path: telemetry.template
- description: TLS - Parameters related to the TLS
displayName: TLS
path: tls
Expand Down
12 changes: 0 additions & 12 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- mariadb.openstack.org
resources:
- mariadbs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- memcached.openstack.org
resources:
Expand Down
7 changes: 0 additions & 7 deletions config/samples/core_v1beta1_openstackcontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ spec:
template:
databaseInstance: openstack
secret: osp-secret
mariadb:
templates:
openstack:
storageRequest: 500M
openstack-cell1:
storageRequest: 500M
galera:
enabled: false
templates:
openstack:
storageClass: local-storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
template:
databaseInstance: openstack
secret: osp-secret
mariadb:
galera:
templates:
openstack:
storageRequest: 500M
Expand Down
8 changes: 0 additions & 8 deletions config/samples/core_v1beta1_openstackcontrolplane_galera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ spec:
template:
databaseInstance: openstack
secret: osp-secret
mariadb:
enabled: false
templates:
openstack:
storageRequest: 500M
openstack-cell1:
storageRequest: 500M
galera:
enabled: true
templates:
openstack:
storageRequest: 500M
Expand Down
Loading