diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 6be7e817f..74f7876db 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -3512,7 +3512,7 @@ spec: galera: properties: enabled: - default: false + default: true type: boolean templates: additionalProperties: @@ -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: diff --git a/apis/core/v1beta1/openstackcontrolplane_types.go b/apis/core/v1beta1/openstackcontrolplane_types.go index 26d5a5bac..75d2510f5 100644 --- a/apis/core/v1beta1/openstackcontrolplane_types.go +++ b/apis/core/v1beta1/openstackcontrolplane_types.go @@ -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 @@ -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"` diff --git a/apis/core/v1beta1/openstackcontrolplane_webhook.go b/apis/core/v1beta1/openstackcontrolplane_webhook.go index ebee0db99..ff8eb10ac 100644 --- a/apis/core/v1beta1/openstackcontrolplane_webhook.go +++ b/apis/core/v1beta1/openstackcontrolplane_webhook.go @@ -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" } } @@ -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 { @@ -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() diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index 7675c7300..57d8f4643 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -226,28 +226,6 @@ func (in *ManilaSection) DeepCopy() *ManilaSection { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MariadbSection) DeepCopyInto(out *MariadbSection) { - *out = *in - if in.Templates != nil { - in, out := &in.Templates, &out.Templates - *out = make(map[string]apiv1beta1.MariaDBSpec, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariadbSection. -func (in *MariadbSection) DeepCopy() *MariadbSection { - if in == nil { - return nil - } - out := new(MariadbSection) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemcachedSection) DeepCopyInto(out *MemcachedSection) { *out = *in @@ -450,7 +428,6 @@ func (in *OpenStackControlPlaneSpec) DeepCopyInto(out *OpenStackControlPlaneSpec in.Placement.DeepCopyInto(&out.Placement) in.Glance.DeepCopyInto(&out.Glance) in.Cinder.DeepCopyInto(&out.Cinder) - in.Mariadb.DeepCopyInto(&out.Mariadb) in.Galera.DeepCopyInto(&out.Galera) in.Rabbitmq.DeepCopyInto(&out.Rabbitmq) in.Memcached.DeepCopyInto(&out.Memcached) diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 6be7e817f..74f7876db 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -3512,7 +3512,7 @@ spec: galera: properties: enabled: - default: false + default: true type: boolean templates: additionalProperties: @@ -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: diff --git a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml index e96e98785..7bf65d02d 100644 --- a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml @@ -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 @@ -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 @@ -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 diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 467687bc9..0d9a9956c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -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: diff --git a/config/samples/core_v1beta1_openstackcontrolplane.yaml b/config/samples/core_v1beta1_openstackcontrolplane.yaml index a1fcca643..2b2ea38c4 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane.yaml @@ -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 diff --git a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml index 136ab94c6..c133079b9 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml @@ -9,7 +9,7 @@ spec: template: databaseInstance: openstack secret: osp-secret - mariadb: + galera: templates: openstack: storageRequest: 500M diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml index 7b5dc99e2..9861494b7 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml @@ -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 diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml index 110fffa64..e7259cddf 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml @@ -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 diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml index ac7332188..d70d21567 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml @@ -94,15 +94,7 @@ spec: type: LoadBalancer databaseInstance: openstack secret: osp-secret - mariadb: - enabled: false - templates: - openstack: - storageRequest: 500M - openstack-cell1: - storageRequest: 500M galera: - enabled: true templates: openstack: storageRequest: 500M diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml index d32eab4f3..80d0e8b8c 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml @@ -116,15 +116,7 @@ spec: type: LoadBalancer databaseInstance: openstack secret: osp-secret - mariadb: - enabled: false - templates: - openstack: - storageRequest: 500M - openstack-cell1: - storageRequest: 500M galera: - enabled: true templates: openstack: storageRequest: 500M diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml index 9ea67b525..f2661f259 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml @@ -116,7 +116,7 @@ spec: type: LoadBalancer databaseInstance: openstack secret: osp-secret - mariadb: + galera: templates: openstack: storageRequest: 500M diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml index 3c5d096ba..046cdc7eb 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml @@ -154,7 +154,7 @@ spec: type: LoadBalancer databaseInstance: openstack secret: osp-secret - mariadb: + galera: templates: openstack: storageRequest: 500M diff --git a/controllers/core/openstackcontrolplane_controller.go b/controllers/core/openstackcontrolplane_controller.go index bb8ff387d..56015d2ce 100644 --- a/controllers/core/openstackcontrolplane_controller.go +++ b/controllers/core/openstackcontrolplane_controller.go @@ -85,7 +85,6 @@ func (r *OpenStackControlPlaneReconciler) GetLogger(ctx context.Context) logr.Lo //+kubebuilder:rbac:groups=cinder.openstack.org,resources=cinders,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=manila.openstack.org,resources=manilas,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=nova.openstack.org,resources=nova,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=mariadb.openstack.org,resources=mariadbs,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=mariadb.openstack.org,resources=galeras,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=memcached.openstack.org,resources=memcacheds,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=neutron.openstack.org,resources=neutronapis,verbs=get;list;watch;create;update;patch;delete @@ -197,13 +196,6 @@ func (r *OpenStackControlPlaneReconciler) reconcileNormal(ctx context.Context, i return ctrlResult, nil } - ctrlResult, err = openstack.ReconcileMariaDBs(ctx, instance, helper) - if err != nil { - return ctrl.Result{}, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil - } - ctrlResult, err = openstack.ReconcileGaleras(ctx, instance, helper) if err != nil { return ctrl.Result{}, err @@ -353,7 +345,6 @@ func (r *OpenStackControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) err For(&corev1beta1.OpenStackControlPlane{}). Owns(&clientv1.OpenStackClient{}). Owns(&corev1.Secret{}). - Owns(&mariadbv1.MariaDB{}). Owns(&mariadbv1.Galera{}). Owns(&memcachedv1.Memcached{}). Owns(&keystonev1.KeystoneAPI{}). diff --git a/pkg/openstack/mariadb.go b/pkg/openstack/mariadb.go deleted file mode 100644 index f283b07a8..000000000 --- a/pkg/openstack/mariadb.go +++ /dev/null @@ -1,130 +0,0 @@ -package openstack - -import ( - "context" - "fmt" - "strings" - - "github.com/openstack-k8s-operators/lib-common/modules/common/condition" - "github.com/openstack-k8s-operators/lib-common/modules/common/helper" - mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1" - - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - - corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" -) - -type mariadbStatus int - -const ( - mariadbFailed mariadbStatus = iota - mariadbCreating mariadbStatus = iota - mariadbReady mariadbStatus = iota -) - -// ReconcileMariaDBs - -func ReconcileMariaDBs( - ctx context.Context, - instance *corev1beta1.OpenStackControlPlane, - helper *helper.Helper, -) (ctrl.Result, error) { - if !instance.Spec.Mariadb.Enabled { - return ctrl.Result{}, nil - } - - var failures []string = []string{} - var inprogress []string = []string{} - - for name, spec := range instance.Spec.Mariadb.Templates { - status, err := reconcileMariaDB(ctx, instance, helper, name, &spec) - - switch status { - case mariadbFailed: - failures = append(failures, fmt.Sprintf("%s(%v)", name, err.Error())) - case mariadbCreating: - inprogress = append(inprogress, name) - case mariadbReady: - default: - return ctrl.Result{}, fmt.Errorf("Invalid mariadbStatus from reconcileMariaDB: %d for MariaDB %s", status, name) - } - } - - if len(failures) > 0 { - errors := strings.Join(failures, ",") - - instance.Status.Conditions.Set(condition.FalseCondition( - corev1beta1.OpenStackControlPlaneMariaDBReadyCondition, - condition.ErrorReason, - condition.SeverityWarning, - corev1beta1.OpenStackControlPlaneMariaDBReadyErrorMessage, - errors)) - - return ctrl.Result{}, fmt.Errorf(errors) - - } else if len(inprogress) > 0 { - instance.Status.Conditions.Set(condition.FalseCondition( - corev1beta1.OpenStackControlPlaneMariaDBReadyCondition, - condition.RequestedReason, - condition.SeverityInfo, - corev1beta1.OpenStackControlPlaneMariaDBReadyRunningMessage)) - } else { - instance.Status.Conditions.MarkTrue( - corev1beta1.OpenStackControlPlaneMariaDBReadyCondition, - corev1beta1.OpenStackControlPlaneMariaDBReadyMessage, - ) - } - - return ctrl.Result{}, nil -} - -// reconcileMariaDB - -func reconcileMariaDB( - ctx context.Context, - instance *corev1beta1.OpenStackControlPlane, - helper *helper.Helper, - name string, - spec *mariadbv1.MariaDBSpec, -) (mariadbStatus, error) { - mariadb := &mariadbv1.MariaDB{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: instance.Namespace, - }, - } - - Log := GetLogger(ctx) - - if !instance.Spec.Mariadb.Enabled { - if _, err := EnsureDeleted(ctx, helper, mariadb); err != nil { - return mariadbFailed, err - } - instance.Status.Conditions.Remove(corev1beta1.OpenStackControlPlaneMariaDBReadyCondition) - return mariadbReady, nil - } - - Log.Info("Reconciling MariaDB", "MariaDB.Namespace", instance.Namespace, "Mariadb.Name", name) - op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), mariadb, func() error { - spec.DeepCopyInto(&mariadb.Spec) - err := controllerutil.SetControllerReference(helper.GetBeforeObject(), mariadb, helper.GetScheme()) - if err != nil { - return err - } - - return nil - }) - - if err != nil { - return mariadbFailed, err - } - if op != controllerutil.OperationResultNone { - Log.Info(fmt.Sprintf("MariaDB %s - %s", mariadb.Name, op)) - } - - if mariadb.IsReady() { - return mariadbReady, nil - } - - return mariadbCreating, nil -} diff --git a/tests/kuttl/common/assert-sample-deployment.yaml b/tests/kuttl/common/assert-sample-deployment.yaml index f134336cf..d07c7cdec 100644 --- a/tests/kuttl/common/assert-sample-deployment.yaml +++ b/tests/kuttl/common/assert-sample-deployment.yaml @@ -8,14 +8,8 @@ spec: template: databaseInstance: openstack secret: osp-secret - mariadb: - templates: - openstack: - storageRequest: 500M - openstack-cell1: - storageRequest: 500M galera: - enabled: false + enabled: true templates: openstack: storageRequest: 500M diff --git a/tests/kuttl/common/errors_cleanup_openstack.yaml b/tests/kuttl/common/errors_cleanup_openstack.yaml index 0da265e39..dffa784c8 100644 --- a/tests/kuttl/common/errors_cleanup_openstack.yaml +++ b/tests/kuttl/common/errors_cleanup_openstack.yaml @@ -1,8 +1,3 @@ -apiVersion: mariadb.openstack.org/v1beta1 -kind: MariaDB -metadata: - name: openstack ---- apiVersion: v1 kind: Pod metadata: diff --git a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml index 0e6cd2d3f..e3524aeae 100644 --- a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml +++ b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml @@ -8,7 +8,7 @@ spec: template: databaseInstance: openstack secret: osp-secret - mariadb: + galera: templates: openstack: storageRequest: 500M diff --git a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml index fb8cc8d88..97cde1f25 100644 --- a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml +++ b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml @@ -8,13 +8,6 @@ spec: template: databaseInstance: openstack secret: osp-secret - mariadb: - enabled: false - templates: - openstack: - storageRequest: 500M - openstack-cell1: - storageRequest: 500M galera: enabled: true templates: diff --git a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml index b40029991..13e74e923 100644 --- a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml +++ b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml @@ -8,13 +8,6 @@ spec: template: databaseInstance: openstack secret: osp-secret - mariadb: - enabled: false - templates: - openstack: - storageRequest: 500M - openstack-cell1: - storageRequest: 500M galera: enabled: true templates: