Skip to content

Commit 6e4b482

Browse files
lmicciniopenshift-merge-bot[bot]
authored andcommitted
Use quorum queues if enabled
With openstack-k8s-operators/infra-operator#429 we added the ability to configure RabbitMQ to use quorum queues. This commit adds a check to verify if "quorumqueues" has been added to the TransportURL secret. If its value is true, the services will be configured to use quorum queues. Jira: https://issues.redhat.com/browse/OSPRH-19160 Assisted-by: claude-4-sonnet
1 parent 1fa8d2b commit 6e4b482

14 files changed

+919
-318
lines changed

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/openstack-k8s-operators/watcher-operator/api
33
go 1.21
44

55
require (
6-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec
6+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f
77
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03
88
k8s.io/api v0.29.15
99
k8s.io/apimachinery v0.29.15

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
7373
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
7474
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
7575
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
76-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec h1:Jvz2BuTWCvjeCbDzpPzlPMrUQpEe04Rzi8LPNxeW0Ts=
77-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec/go.mod h1:Dv8qpmBIQy3Jv/EyQnOyc0w61X8vyfxpjcIQONP5CwY=
76+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f h1:chuu4iBT5sXHYw8aPeP/pWC+S3yGo6hdy39foP7c5vs=
77+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f/go.mod h1:Dv8qpmBIQy3Jv/EyQnOyc0w61X8vyfxpjcIQONP5CwY=
7878
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03 h1:9VanDdvg1APf9B1nzGElLvWr6dM5GsSayMLSV/nJZnE=
7979
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03/go.mod h1:Z+rmtn3qhuPZfx2EDVmloUh2MkYbvDMgcpJneRYerS0=
8080
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

controllers/watcher_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ const (
7171
TransportURLSelector = "transport_url"
7272
// NotificationURLSelector is the name of key in the secret created by the notification TransportURL
7373
NotificationURLSelector = "notification_url"
74+
// QuorumQueuesSelector is the name of key in the secret created by TransportURL for quorum queues enablement
75+
QuorumQueuesSelector = "quorumqueues"
7476
// DatabaseAccount is the name of key in the secret for the name of the Database Acount object
7577
DatabaseAccount = "database_account"
7678
// DatabaseUsername is the name of key in the secret for the user name used to login to the database

controllers/watcher_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ func (r *WatcherReconciler) createSubLevelSecret(
878878
data := map[string]string{
879879
*instance.Spec.PasswordSelectors.Service: string(inputSecret.Data[*instance.Spec.PasswordSelectors.Service]),
880880
TransportURLSelector: string(transportURLSecret.Data[TransportURLSelector]),
881+
QuorumQueuesSelector: string(transportURLSecret.Data[QuorumQueuesSelector]),
881882
DatabaseAccount: databaseAccount.Name,
882883
DatabaseUsername: databaseAccount.Spec.UserName,
883884
DatabasePassword: string(databaseSecret.Data[mariadbv1.DatabasePasswordSelector]),

controllers/watcherapi_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func (r *WatcherAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request)
168168
[]string{
169169
*instance.Spec.PasswordSelectors.Service,
170170
TransportURLSelector,
171+
QuorumQueuesSelector,
171172
DatabaseAccount,
172173
DatabaseUsername,
173174
DatabaseHostname,
@@ -455,6 +456,7 @@ func (r *WatcherAPIReconciler) generateServiceConfigs(
455456
"ServicePassword": string(secret.Data[*instance.Spec.PasswordSelectors.Service]),
456457
"ServiceUser": *instance.Spec.ServiceUser,
457458
"TransportURL": string(secret.Data[TransportURLSelector]),
459+
"QuorumQueues": string(secret.Data[QuorumQueuesSelector]) == "true",
458460
"MemcachedServers": memcachedInstance.GetMemcachedServerListString(),
459461
"MemcachedServersWithInet": memcachedInstance.GetMemcachedServerListWithInetString(),
460462
"MemcachedTLS": memcachedInstance.GetMemcachedTLSSupport(),

controllers/watcherapplier_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ func (r *WatcherApplierReconciler) Reconcile(ctx context.Context, req ctrl.Reque
165165
[]string{
166166
*instance.Spec.PasswordSelectors.Service,
167167
TransportURLSelector,
168+
QuorumQueuesSelector,
168169
DatabaseAccount,
169170
DatabaseUsername,
170171
DatabaseHostname,
@@ -422,6 +423,7 @@ func (r *WatcherApplierReconciler) generateServiceConfigs(
422423
"ServicePassword": string(secret.Data[*instance.Spec.PasswordSelectors.Service]),
423424
"ServiceUser": *instance.Spec.ServiceUser,
424425
"TransportURL": string(secret.Data[TransportURLSelector]),
426+
"QuorumQueues": string(secret.Data[QuorumQueuesSelector]) == "true",
425427
"MemcachedServers": memcachedInstance.GetMemcachedServerListString(),
426428
"MemcachedServersWithInet": memcachedInstance.GetMemcachedServerListWithInetString(),
427429
"MemcachedTLS": memcachedInstance.GetMemcachedTLSSupport(),

controllers/watcherdecisionengine_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (r *WatcherDecisionEngineReconciler) Reconcile(ctx context.Context, req ctr
163163
[]string{
164164
*instance.Spec.PasswordSelectors.Service,
165165
TransportURLSelector,
166+
QuorumQueuesSelector,
166167
DatabaseAccount,
167168
DatabaseUsername,
168169
DatabaseHostname,
@@ -548,6 +549,7 @@ func (r *WatcherDecisionEngineReconciler) generateServiceConfigs(
548549
"ServicePassword": string(secret.Data[*instance.Spec.PasswordSelectors.Service]),
549550
"ServiceUser": *instance.Spec.ServiceUser,
550551
"TransportURL": string(secret.Data[TransportURLSelector]),
552+
"QuorumQueues": string(secret.Data[QuorumQueuesSelector]) == "true",
551553
"MemcachedServers": memcachedInstance.GetMemcachedServerListString(),
552554
"MemcachedServersWithInet": memcachedInstance.GetMemcachedServerListWithInetString(),
553555
"MemcachedTLS": memcachedInstance.GetMemcachedTLSSupport(),

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/onsi/ginkgo/v2 v2.20.1
99
github.com/onsi/gomega v1.34.1
1010
github.com/openshift/api v3.9.0+incompatible
11-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec
11+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f
1212
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250905083405-40d18a7ca650
1313
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03
1414
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20250823121217-7e1cd2e3dd03

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
7878
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
7979
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6Beb1gQ96Ptej9AE/BvwCBiRj1E=
8080
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
81-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec h1:Jvz2BuTWCvjeCbDzpPzlPMrUQpEe04Rzi8LPNxeW0Ts=
82-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250821143610-c8ef7b9a21ec/go.mod h1:Dv8qpmBIQy3Jv/EyQnOyc0w61X8vyfxpjcIQONP5CwY=
81+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f h1:chuu4iBT5sXHYw8aPeP/pWC+S3yGo6hdy39foP7c5vs=
82+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f/go.mod h1:Dv8qpmBIQy3Jv/EyQnOyc0w61X8vyfxpjcIQONP5CwY=
8383
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250905083405-40d18a7ca650 h1:n1s6jr8GJ6cn/1tjLVGPkTURb4ooHwjdS5YeppKdB0g=
8484
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250905083405-40d18a7ca650/go.mod h1:G6BkoPfgALryMlOZwIH036iSWUMiDJQAYL1lXuLyPZ0=
8585
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03 h1:9VanDdvg1APf9B1nzGElLvWr6dM5GsSayMLSV/nJZnE=

templates/00-default.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ driver = noop
2626
{{ end }}
2727

2828
[oslo_messaging_rabbit]
29+
{{- if (index . "QuorumQueues") }}
30+
rabbit_quorum_queue=true
31+
rabbit_transient_quorum_queue=true
32+
amqp_durable_queues=true
33+
{{- else }}
2934
amqp_durable_queues=false
3035
amqp_auto_delete=false
3136
heartbeat_in_pthread=false
37+
{{- end }}
3238

3339
{{ if (index . "KeystoneAuthURL") }}
3440
[keystone_authtoken]

0 commit comments

Comments
 (0)