@@ -86,7 +86,7 @@ var _ = Describe("Cinder controller", func() {
8686 Expect (Cinder .Spec .DatabaseInstance ).Should (Equal ("openstack" ))
8787 Expect (Cinder .Spec .DatabaseAccount ).Should (Equal (cinderTest .CinderDataBaseAccount ))
8888 Expect (Cinder .Spec .MemcachedInstance ).Should (Equal (cinderTest .MemcachedInstance ))
89- Expect (Cinder .Spec .RabbitMqClusterName ).Should (Equal (cinderTest .RabbitmqClusterName ))
89+ Expect (Cinder .Spec .MessagingBus . Cluster ).Should (Equal (cinderTest .RabbitmqClusterName ))
9090 Expect (Cinder .Spec .ServiceUser ).Should (Equal (cinderTest .CinderServiceUser ))
9191 })
9292 It ("should have the Status fields initialized" , func () {
@@ -464,9 +464,11 @@ var _ = Describe("Cinder controller", func() {
464464 }
465465
466466 rawSpec := map [string ]any {
467- "secret" : SecretName ,
468- "databaseInstance" : "openstack" ,
469- "rabbitMqClusterName" : "rabbitmq" ,
467+ "secret" : SecretName ,
468+ "databaseInstance" : "openstack" ,
469+ "messagingBus" : map [string ]any {
470+ "cluster" : "rabbitmq" ,
471+ },
470472 "cinderAPI" : map [string ]any {
471473 "containerImage" : cinderv1 .CinderAPIContainerImage ,
472474 "networkAttachments" : []string {"internalapi" },
@@ -1229,10 +1231,12 @@ var _ = Describe("Cinder controller", func() {
12291231 When ("Cinder CR instance is built with ExtraMounts" , func () {
12301232 BeforeEach (func () {
12311233 rawSpec := map [string ]any {
1232- "secret" : SecretName ,
1233- "databaseInstance" : "openstack" ,
1234- "rabbitMqClusterName" : "rabbitmq" ,
1235- "extraMounts" : GetExtraMounts (),
1234+ "secret" : SecretName ,
1235+ "databaseInstance" : "openstack" ,
1236+ "messagingBus" : map [string ]any {
1237+ "cluster" : "rabbitmq" ,
1238+ },
1239+ "extraMounts" : GetExtraMounts (),
12361240 "cinderAPI" : map [string ]any {
12371241 "containerImage" : cinderv1 .CinderAPIContainerImage ,
12381242 },
@@ -1293,10 +1297,14 @@ var _ = Describe("Cinder controller", func() {
12931297 When ("Cinder instance has notifications enabled" , func () {
12941298 BeforeEach (func () {
12951299 rawSpec := map [string ]any {
1296- "secret" : SecretName ,
1297- "databaseInstance" : "openstack" ,
1298- "rabbitMqClusterName" : "rabbitmq" ,
1299- "notificationsBusInstance" : "rabbitmq" ,
1300+ "secret" : SecretName ,
1301+ "databaseInstance" : "openstack" ,
1302+ "messagingBus" : map [string ]any {
1303+ "cluster" : "rabbitmq" ,
1304+ },
1305+ "notificationsBus" : map [string ]any {
1306+ "cluster" : "rabbitmq" ,
1307+ },
13001308 "cinderAPI" : map [string ]any {
13011309 "containerImage" : cinderv1 .CinderAPIContainerImage ,
13021310 },
@@ -2049,10 +2057,10 @@ var _ = Describe("Cinder with RabbitMQ custom vhost and user", func() {
20492057 "vhost" : "main-vhost" ,
20502058 }
20512059 spec ["notificationsBus" ] = map [string ]any {
2052- "user" : "notifications-user" ,
2053- "vhost" : "notifications-vhost" ,
2060+ "cluster" : "rabbitmq-notifications" ,
2061+ "user" : "notifications-user" ,
2062+ "vhost" : "notifications-vhost" ,
20542063 }
2055- spec ["notificationsBusInstance" ] = "rabbitmq-notifications"
20562064 DeferCleanup (th .DeleteInstance , CreateCinder (cinderTest .Instance , spec ))
20572065 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , cinderTest .RabbitmqSecretName ))
20582066 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , "rabbitmq-notifications-secret" ))
@@ -2102,7 +2110,9 @@ var _ = Describe("Cinder with RabbitMQ custom vhost and user", func() {
21022110 When ("Cinder is created with notifications bus using default credentials" , func () {
21032111 BeforeEach (func () {
21042112 spec := GetDefaultCinderSpec ()
2105- spec ["notificationsBusInstance" ] = "rabbitmq-notifications"
2113+ spec ["notificationsBus" ] = map [string ]any {
2114+ "cluster" : "rabbitmq-notifications" ,
2115+ }
21062116 DeferCleanup (th .DeleteInstance , CreateCinder (cinderTest .Instance , spec ))
21072117 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , cinderTest .RabbitmqSecretName ))
21082118 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , "rabbitmq-notifications-secret" ))
@@ -2224,7 +2234,9 @@ var _ = Describe("Cinder with RabbitMQ custom vhost and user", func() {
22242234 BeforeEach (func () {
22252235 spec := GetDefaultCinderSpec ()
22262236 // Start with notifications enabled
2227- spec ["notificationsBusInstance" ] = "rabbitmq-notifications"
2237+ spec ["notificationsBus" ] = map [string ]any {
2238+ "cluster" : "rabbitmq-notifications" ,
2239+ }
22282240 DeferCleanup (th .DeleteInstance , CreateCinder (cinderTest .Instance , spec ))
22292241 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , cinderTest .RabbitmqSecretName ))
22302242 DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , "rabbitmq-notifications-secret" ))
0 commit comments