Skip to content

Commit

Permalink
Merge pull request #354 from kajinamit/enable-memcached
Browse files Browse the repository at this point in the history
Enable memcached by default
  • Loading branch information
openshift-merge-robot authored Jun 28, 2023
2 parents 41bc4b6 + 6da269d commit 35cc2a2
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5279,7 +5279,7 @@ spec:
memcached:
properties:
enabled:
default: false
default: true
type: boolean
templates:
additionalProperties:
Expand Down
5 changes: 4 additions & 1 deletion apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type OpenStackControlPlaneSpec struct {
Rabbitmq RabbitmqSection `json:"rabbitmq,omitempty"`

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

Expand Down Expand Up @@ -274,11 +275,13 @@ type RabbitmqSection struct {
// MemcachedSection defines the desired state of Memcached services
type MemcachedSection 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 Memcached services 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 Memcached databases
Templates map[string]memcachedv1.MemcachedSpec `json:"templates,omitempty"`
}
Expand Down
41 changes: 22 additions & 19 deletions apis/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,41 +111,44 @@ func (r *OpenStackControlPlane) checkDepsEnabled(name string) string {

switch name {
case "Keystone":
if !(r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) {
reqs = "MariaDB or Galera"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled) {
reqs = "MariaDB or Galera, Memcached"
}
case "Glance":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
}
case "Cinder":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Rabbitmq.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone, RabbitMQ"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone"
}
case "Placement":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
}
case "Neutron":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Rabbitmq.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone, RabbitMQ"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, RabbitMQ, Keystone"
}
case "Nova":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.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, Glance, Keystone, Neutron, Placement, RabbitMQ"
if !((r.Spec.Mariadb.Enabled || 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"
}
case "Heat":
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Rabbitmq.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone, RabbitMQ"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Rabbitmq.Enabled &&
r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, RabbitMQ, Keystone"
}
case "Swift":
if !(r.Spec.Keystone.Enabled) {
reqs = "Keystone"
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.Keystone.Enabled) {
reqs = "MariaDB or Galera, Keystone"
if !((r.Spec.Mariadb.Enabled || r.Spec.Galera.Enabled) && r.Spec.Memcached.Enabled && r.Spec.Keystone.Enabled) {
reqs = "MariaDB or Galera, Memcached, Keystone"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5279,7 +5279,7 @@ spec:
memcached:
properties:
enabled:
default: false
default: true
type: boolean
templates:
additionalProperties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ spec:
- 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
- description: Enabled - Whether Memcached services should be deployed and managed
displayName: Enabled
path: memcached.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Templates - Overrides to use when creating the Memcached databases
displayName: Templates
path: memcached.templates
- description: Neutron - Overrides to use when creating the Neutron Service
displayName: Neutron
path: neutron
Expand Down
4 changes: 3 additions & 1 deletion config/samples/core_v1beta1_openstackcontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ spec:
rabbitmq-cell1:
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ spec:
# cpu: 800m
# memory: 1Gi
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ spec:
rabbitmq-cell1:
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ spec:
rabbitmq-cell1:
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ spec:
secret: osp-secret
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
neutron:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ spec:
openstack-cell1:
storageRequest: 500M
memcached:
enabled: true
templates:
memcached:
replicas: 1
neutron:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ spec:
openstack-cell1:
storageRequest: 500M
memcached:
enabled: true
templates:
memcached:
replicas: 1
neutron:
template:
databaseInstance: openstack
Expand Down
4 changes: 3 additions & 1 deletion tests/kuttl/common/assert-sample-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ spec:
rabbitmq-cell1:
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
4 changes: 3 additions & 1 deletion tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ spec:
# cpu: 800m
# memory: 1Gi
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ spec:
rabbitmq-cell1:
replicas: 1
memcached:
enabled: true
templates:
memcached:
replicas: 1
placement:
template:
databaseInstance: openstack
Expand Down

0 comments on commit 35cc2a2

Please sign in to comment.