@@ -384,6 +384,39 @@ 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+ notificationTransportURL , notificationMQStatus , notificationMQError := r .ensureMQ (
394+ ctx , h , instance , instance .Name + "-notification-transport" , notificationBusName )
395+
396+ switch notificationMQStatus {
397+ case nova .MQFailed :
398+ instance .Status .Conditions .Set (condition .FalseCondition (
399+ novav1 .NovaNotificationMQReadyCondition ,
400+ condition .ErrorReason ,
401+ condition .SeverityError ,
402+ novav1 .NovaNotificationMQReadyErrorMessage ,
403+ notificationMQError .Error (),
404+ ))
405+ case nova .MQCreating :
406+ instance .Status .Conditions .Set (condition .FalseCondition (
407+ novav1 .NovaNotificationMQReadyCondition ,
408+ condition .ErrorReason ,
409+ condition .SeverityError ,
410+ novav1 .NovaNotificationMQReadyCreatingMessage ,
411+ ))
412+ case nova .MQCompleted :
413+ instance .Status .Conditions .MarkTrue (
414+ novav1 .NovaNotificationMQReadyCondition , novav1 .NovaNotificationMQReadyMessage )
415+ default :
416+ return ctrl.Result {}, fmt .Errorf ("%w from for the Notification MQ: %d" ,
417+ util .ErrInvalidStatus , notificationMQStatus )
418+ }
419+
387420 cellMQs := map [string ]* nova.MessageBus {}
388421 var failedMQs []string
389422 var creatingMQs []string
@@ -539,7 +572,11 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
539572 return ctrl.Result {}, nil
540573 }
541574
542- topLevelSecretName , err := r .ensureTopLevelSecret (ctx , h , instance , apiTransportURL , secret )
575+ topLevelSecretName , err := r .ensureTopLevelSecret (
576+ ctx , h , instance ,
577+ apiTransportURL ,
578+ notificationTransportURL ,
579+ secret )
543580 if err != nil {
544581 return ctrl.Result {}, err
545582 }
@@ -1639,6 +1676,7 @@ func (r *NovaReconciler) ensureMQ(
16391676
16401677 err = r .Client .Get (ctx , types.NamespacedName {Namespace : instance .Namespace , Name : transportName }, transportURL )
16411678 if err != nil && ! k8s_errors .IsNotFound (err ) {
1679+ Log .Info ("" , ":" , "t-url-3" )
16421680 return "" , nova .MQFailed , util .WrapErrorForObject (
16431681 fmt .Sprintf ("Error reading TransportURL object %s" , transportName ),
16441682 transportURL ,
@@ -1651,6 +1689,7 @@ func (r *NovaReconciler) ensureMQ(
16511689 }
16521690
16531691 secretName := types.NamespacedName {Namespace : instance .Namespace , Name : transportURL .Status .SecretName }
1692+
16541693 secret := & corev1.Secret {}
16551694 err = h .GetClient ().Get (ctx , secretName , secret )
16561695 if err != nil {
@@ -1665,7 +1704,6 @@ func (r *NovaReconciler) ensureMQ(
16651704 return "" , nova .MQFailed , fmt .Errorf (
16661705 "%w: the TransportURL secret %s does not have 'transport_url' field" , util .ErrFieldNotFound , transportURL .Status .SecretName )
16671706 }
1668-
16691707 return string (url ), nova .MQCompleted , nil
16701708}
16711709
@@ -1919,14 +1957,16 @@ func (r *NovaReconciler) ensureTopLevelSecret(
19191957 h * helper.Helper ,
19201958 instance * novav1.Nova ,
19211959 apiTransportURL string ,
1960+ notificationTransportURL string ,
19221961 externalSecret corev1.Secret ,
19231962) (string , error ) {
19241963 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19251964 // the subCR fields, possibly hostnames or usernames.
19261965 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 ,
1966+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1967+ MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
1968+ TransportURLSelector : apiTransportURL ,
1969+ NotificationTransportURLSelector : notificationTransportURL ,
19301970 }
19311971
19321972 // NOTE(gibi): When we switch to immutable secrets then we need to include
0 commit comments