@@ -26,7 +26,6 @@ import (
2626 "fmt"
2727
2828 "github.com/google/go-cmp/cmp"
29- rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
3029 topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
3130 service "github.com/openstack-k8s-operators/lib-common/modules/common/service"
3231 "github.com/robfig/cron/v3"
@@ -89,23 +88,14 @@ func (spec *NovaSpecCore) Default() {
8988 spec .APITimeout = novaDefaults .APITimeout
9089 }
9190
92- // Default MessagingBus.Cluster from APIMessageBusInstance if not already set
91+ // Default MessagingBus.Cluster if not set
92+ // Migration from deprecated fields is handled by openstack-operator
9393 if spec .MessagingBus .Cluster == "" {
94- spec .MessagingBus .Cluster = spec . APIMessageBusInstance
94+ spec .MessagingBus .Cluster = "rabbitmq"
9595 }
9696
97- // Default NotificationsBus if NotificationsBusInstance is specified
98- if spec .NotificationsBusInstance != nil && * spec .NotificationsBusInstance != "" {
99- if spec .NotificationsBus == nil {
100- // Initialize empty NotificationsBus - credentials will be created dynamically
101- // to ensure separation from MessagingBus (RPC and notifications should never share credentials)
102- spec .NotificationsBus = & rabbitmqv1.RabbitMqConfig {}
103- }
104- // Default cluster name if not already set
105- if spec .NotificationsBus .Cluster == "" {
106- spec .NotificationsBus .Cluster = * spec .NotificationsBusInstance
107- }
108- }
97+ // NotificationsBus.Cluster is not defaulted - it must be explicitly set if NotificationsBus is configured
98+ // This ensures users make a conscious choice about which cluster to use for notifications
10999
110100 for cellName , cellTemplate := range spec .CellTemplates {
111101
@@ -125,9 +115,14 @@ func (spec *NovaSpecCore) Default() {
125115 }
126116 }
127117
128- // Default MessagingBus.Cluster from CellMessageBusInstance if not already set
118+ // Default MessagingBus.Cluster if not set
119+ // Migration from deprecated fields is handled by openstack-operator
129120 if cellTemplate .MessagingBus .Cluster == "" {
130- cellTemplate .MessagingBus .Cluster = cellTemplate .CellMessageBusInstance
121+ if cellName == Cell0Name {
122+ cellTemplate .MessagingBus .Cluster = "rabbitmq"
123+ } else {
124+ cellTemplate .MessagingBus .Cluster = "rabbitmq-" + cellName
125+ }
131126 }
132127
133128 // "cellTemplate" is a by-value copy, so we need to re-inject the updated version of it into the map
0 commit comments