@@ -391,6 +391,49 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
391391 return ctrl.Result {}, fmt .Errorf ("%w from for the API MQ: %d" , util .ErrInvalidStatus , apiMQStatus )
392392 }
393393
394+ // nova broadcaster rabbit
395+ notificationBusName := ""
396+ if instance .Spec .NotificationsBusInstance != nil {
397+ notificationBusName = * instance .Spec .NotificationsBusInstance
398+ }
399+
400+ var notificationTransportURL string
401+ var notificationMQStatus nova.MessageBusStatus
402+ var notificationMQError error
403+
404+ if notificationBusName != "" {
405+ notificationTransportURL , notificationMQStatus , notificationMQError = r .ensureMQ (
406+ ctx , h , instance , instance .Name + "-notification-transport" , notificationBusName )
407+
408+ switch notificationMQStatus {
409+ case nova .MQFailed :
410+ instance .Status .Conditions .Set (condition .FalseCondition (
411+ novav1 .NovaNotificationMQReadyCondition ,
412+ condition .ErrorReason ,
413+ condition .SeverityError ,
414+ novav1 .NovaNotificationMQReadyErrorMessage ,
415+ notificationMQError .Error (),
416+ ))
417+ case nova .MQCreating :
418+ instance .Status .Conditions .Set (condition .FalseCondition (
419+ novav1 .NovaNotificationMQReadyCondition ,
420+ condition .ErrorReason ,
421+ condition .SeverityError ,
422+ novav1 .NovaNotificationMQReadyCreatingMessage ,
423+ ))
424+ case nova .MQCompleted :
425+ instance .Status .Conditions .MarkTrue (
426+ novav1 .NovaNotificationMQReadyCondition , novav1 .NovaNotificationMQReadyMessage )
427+ default :
428+ return ctrl.Result {}, fmt .Errorf ("%w from for the Notification MQ: %d" ,
429+ util .ErrInvalidStatus , notificationMQStatus )
430+ }
431+ } else {
432+ instance .Status .Conditions .MarkTrue (
433+ novav1 .NovaNotificationMQReadyCondition , novav1 .NovaNotificationMQNotRequestedMessage )
434+
435+ }
436+
394437 cellMQs := map [string ]* nova.MessageBus {}
395438 var failedMQs []string
396439 var creatingMQs []string
@@ -481,7 +524,7 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
481524 }
482525 cell , status , err := r .ensureCell (
483526 ctx , h , instance , cellName , cellTemplate ,
484- cellDB .Database , apiDB , cellMQ .TransportURL ,
527+ cellDB .Database , apiDB , cellMQ .TransportURL , notificationTransportURL ,
485528 keystoneInternalAuthURL , secret ,
486529 )
487530 cells [cellName ] = cell
@@ -546,7 +589,11 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
546589 return ctrl.Result {}, nil
547590 }
548591
549- topLevelSecretName , err := r .ensureTopLevelSecret (ctx , h , instance , apiTransportURL , secret )
592+ topLevelSecretName , err := r .ensureTopLevelSecret (
593+ ctx , h , instance ,
594+ apiTransportURL ,
595+ notificationTransportURL ,
596+ secret )
550597 if err != nil {
551598 return ctrl.Result {}, err
552599 }
@@ -936,6 +983,11 @@ func (r *NovaReconciler) initConditions(
936983 condition .InitReason ,
937984 condition .MemcachedReadyInitMessage ,
938985 ),
986+ condition .UnknownCondition (
987+ novav1 .NovaNotificationMQReadyCondition ,
988+ condition .InitReason ,
989+ novav1 .NovaNotificationMQReadyInitMessage ,
990+ ),
939991 )
940992 instance .Status .Conditions .Init (& cl )
941993 return nil
@@ -1133,12 +1185,16 @@ func (r *NovaReconciler) ensureCell(
11331185 cellDB * mariadbv1.Database ,
11341186 apiDB * mariadbv1.Database ,
11351187 cellTransportURL string ,
1188+ notificationTransportURL string ,
11361189 keystoneAuthURL string ,
11371190 secret corev1.Secret ,
11381191) (* novav1.NovaCell , nova.CellDeploymentStatus , error ) {
11391192 Log := r .GetLogger (ctx )
11401193
1141- cellSecretName , err := r .ensureCellSecret (ctx , h , instance , cellName , cellTemplate , cellTransportURL , secret )
1194+ cellSecretName , err := r .ensureCellSecret (
1195+ ctx , h , instance , cellName , cellTemplate ,
1196+ cellTransportURL , notificationTransportURL ,
1197+ secret )
11421198 if err != nil {
11431199 return nil , nova .CellDeploying , err
11441200 }
@@ -1684,6 +1740,7 @@ func (r *NovaReconciler) ensureMQ(
16841740 }
16851741
16861742 secretName := types.NamespacedName {Namespace : instance .Namespace , Name : transportURL .Status .SecretName }
1743+
16871744 secret := & corev1.Secret {}
16881745 err = h .GetClient ().Get (ctx , secretName , secret )
16891746 if err != nil {
@@ -1698,7 +1755,6 @@ func (r *NovaReconciler) ensureMQ(
16981755 return "" , nova .MQFailed , fmt .Errorf (
16991756 "%w: the TransportURL secret %s does not have 'transport_url' field" , util .ErrFieldNotFound , transportURL .Status .SecretName )
17001757 }
1701-
17021758 return string (url ), nova .MQCompleted , nil
17031759}
17041760
@@ -1902,13 +1958,15 @@ func (r *NovaReconciler) ensureCellSecret(
19021958 cellName string ,
19031959 cellTemplate novav1.NovaCellTemplate ,
19041960 cellTransportURL string ,
1961+ notificationTransportURL string ,
19051962 externalSecret corev1.Secret ,
19061963) (string , error ) {
19071964 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19081965 // the NovaCellSpec fields, possibly hostnames or usernames.
19091966 data := map [string ]string {
1910- ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1911- TransportURLSelector : cellTransportURL ,
1967+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1968+ TransportURLSelector : cellTransportURL ,
1969+ NotificationTransportURLSelector : notificationTransportURL ,
19121970 }
19131971
19141972 // If metadata is enabled in the cell then the cell secret needs the
@@ -1952,14 +2010,16 @@ func (r *NovaReconciler) ensureTopLevelSecret(
19522010 h * helper.Helper ,
19532011 instance * novav1.Nova ,
19542012 apiTransportURL string ,
2013+ notificationTransportURL string ,
19552014 externalSecret corev1.Secret ,
19562015) (string , error ) {
19572016 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19582017 // the subCR fields, possibly hostnames or usernames.
19592018 data := map [string ]string {
1960- ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1961- MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
1962- TransportURLSelector : apiTransportURL ,
2019+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
2020+ MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
2021+ TransportURLSelector : apiTransportURL ,
2022+ NotificationTransportURLSelector : notificationTransportURL ,
19632023 }
19642024
19652025 // NOTE(gibi): When we switch to immutable secrets then we need to include
0 commit comments