@@ -384,6 +384,45 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
384384 return ctrl.Result {}, fmt .Errorf ("%w from for the API MQ: %d" , util .ErrInvalidStatus , apiMQStatus )
385385 }
386386
387+ // nova broadcaster rabbit
388+ notificationBusName := ""
389+ if instance .Spec .NotificationsBusInstance != nil {
390+ notificationBusName = * instance .Spec .NotificationsBusInstance
391+ }
392+
393+ var notificationTransportURL string
394+ var notificationMQStatus nova.MessageBusStatus
395+ var notificationMQError error
396+
397+ if notificationBusName != "" {
398+ notificationTransportURL , notificationMQStatus , notificationMQError = r .ensureMQ (
399+ ctx , h , instance , instance .Name + "-notification-transport" , notificationBusName )
400+
401+ switch notificationMQStatus {
402+ case nova .MQFailed :
403+ instance .Status .Conditions .Set (condition .FalseCondition (
404+ novav1 .NovaNotificationMQReadyCondition ,
405+ condition .ErrorReason ,
406+ condition .SeverityError ,
407+ novav1 .NovaNotificationMQReadyErrorMessage ,
408+ notificationMQError .Error (),
409+ ))
410+ case nova .MQCreating :
411+ instance .Status .Conditions .Set (condition .FalseCondition (
412+ novav1 .NovaNotificationMQReadyCondition ,
413+ condition .ErrorReason ,
414+ condition .SeverityError ,
415+ novav1 .NovaNotificationMQReadyCreatingMessage ,
416+ ))
417+ case nova .MQCompleted :
418+ instance .Status .Conditions .MarkTrue (
419+ novav1 .NovaNotificationMQReadyCondition , novav1 .NovaNotificationMQReadyMessage )
420+ default :
421+ return ctrl.Result {}, fmt .Errorf ("%w from for the Notification MQ: %d" ,
422+ util .ErrInvalidStatus , notificationMQStatus )
423+ }
424+ }
425+
387426 cellMQs := map [string ]* nova.MessageBus {}
388427 var failedMQs []string
389428 var creatingMQs []string
@@ -539,7 +578,11 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
539578 return ctrl.Result {}, nil
540579 }
541580
542- topLevelSecretName , err := r .ensureTopLevelSecret (ctx , h , instance , apiTransportURL , secret )
581+ topLevelSecretName , err := r .ensureTopLevelSecret (
582+ ctx , h , instance ,
583+ apiTransportURL ,
584+ notificationTransportURL ,
585+ secret )
543586 if err != nil {
544587 return ctrl.Result {}, err
545588 }
@@ -1639,6 +1682,7 @@ func (r *NovaReconciler) ensureMQ(
16391682
16401683 err = r .Client .Get (ctx , types.NamespacedName {Namespace : instance .Namespace , Name : transportName }, transportURL )
16411684 if err != nil && ! k8s_errors .IsNotFound (err ) {
1685+ Log .Info ("" , ":" , "t-url-3" )
16421686 return "" , nova .MQFailed , util .WrapErrorForObject (
16431687 fmt .Sprintf ("Error reading TransportURL object %s" , transportName ),
16441688 transportURL ,
@@ -1651,6 +1695,7 @@ func (r *NovaReconciler) ensureMQ(
16511695 }
16521696
16531697 secretName := types.NamespacedName {Namespace : instance .Namespace , Name : transportURL .Status .SecretName }
1698+
16541699 secret := & corev1.Secret {}
16551700 err = h .GetClient ().Get (ctx , secretName , secret )
16561701 if err != nil {
@@ -1665,7 +1710,6 @@ func (r *NovaReconciler) ensureMQ(
16651710 return "" , nova .MQFailed , fmt .Errorf (
16661711 "%w: the TransportURL secret %s does not have 'transport_url' field" , util .ErrFieldNotFound , transportURL .Status .SecretName )
16671712 }
1668-
16691713 return string (url ), nova .MQCompleted , nil
16701714}
16711715
@@ -1919,14 +1963,16 @@ func (r *NovaReconciler) ensureTopLevelSecret(
19191963 h * helper.Helper ,
19201964 instance * novav1.Nova ,
19211965 apiTransportURL string ,
1966+ notificationTransportURL string ,
19221967 externalSecret corev1.Secret ,
19231968) (string , error ) {
19241969 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19251970 // the subCR fields, possibly hostnames or usernames.
19261971 data := map [string ]string {
1927- ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1928- MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
1929- TransportURLSelector : apiTransportURL ,
1972+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1973+ MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
1974+ TransportURLSelector : apiTransportURL ,
1975+ NotificationTransportURLSelector : notificationTransportURL ,
19301976 }
19311977
19321978 // NOTE(gibi): When we switch to immutable secrets then we need to include
0 commit comments