@@ -391,6 +391,47 @@ 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 .Remove (novav1 .NovaNotificationMQReadyCondition )
433+ }
434+
394435 cellMQs := map [string ]* nova.MessageBus {}
395436 var failedMQs []string
396437 var creatingMQs []string
@@ -481,7 +522,7 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
481522 }
482523 cell , status , err := r .ensureCell (
483524 ctx , h , instance , cellName , cellTemplate ,
484- cellDB .Database , apiDB , cellMQ .TransportURL ,
525+ cellDB .Database , apiDB , cellMQ .TransportURL , notificationTransportURL ,
485526 keystoneInternalAuthURL , secret ,
486527 )
487528 cells [cellName ] = cell
@@ -546,7 +587,11 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
546587 return ctrl.Result {}, nil
547588 }
548589
549- topLevelSecretName , err := r .ensureTopLevelSecret (ctx , h , instance , apiTransportURL , secret )
590+ topLevelSecretName , err := r .ensureTopLevelSecret (
591+ ctx , h , instance ,
592+ apiTransportURL ,
593+ notificationTransportURL ,
594+ secret )
550595 if err != nil {
551596 return ctrl.Result {}, err
552597 }
@@ -936,6 +981,11 @@ func (r *NovaReconciler) initConditions(
936981 condition .InitReason ,
937982 condition .MemcachedReadyInitMessage ,
938983 ),
984+ condition .UnknownCondition (
985+ novav1 .NovaNotificationMQReadyCondition ,
986+ condition .InitReason ,
987+ novav1 .NovaNotificationMQReadyInitMessage ,
988+ ),
939989 )
940990 instance .Status .Conditions .Init (& cl )
941991 return nil
@@ -1133,12 +1183,16 @@ func (r *NovaReconciler) ensureCell(
11331183 cellDB * mariadbv1.Database ,
11341184 apiDB * mariadbv1.Database ,
11351185 cellTransportURL string ,
1186+ notificationTransportURL string ,
11361187 keystoneAuthURL string ,
11371188 secret corev1.Secret ,
11381189) (* novav1.NovaCell , nova.CellDeploymentStatus , error ) {
11391190 Log := r .GetLogger (ctx )
11401191
1141- cellSecretName , err := r .ensureCellSecret (ctx , h , instance , cellName , cellTemplate , cellTransportURL , secret )
1192+ cellSecretName , err := r .ensureCellSecret (
1193+ ctx , h , instance , cellName , cellTemplate ,
1194+ cellTransportURL , notificationTransportURL ,
1195+ secret )
11421196 if err != nil {
11431197 return nil , nova .CellDeploying , err
11441198 }
@@ -1684,6 +1738,7 @@ func (r *NovaReconciler) ensureMQ(
16841738 }
16851739
16861740 secretName := types.NamespacedName {Namespace : instance .Namespace , Name : transportURL .Status .SecretName }
1741+
16871742 secret := & corev1.Secret {}
16881743 err = h .GetClient ().Get (ctx , secretName , secret )
16891744 if err != nil {
@@ -1698,7 +1753,6 @@ func (r *NovaReconciler) ensureMQ(
16981753 return "" , nova .MQFailed , fmt .Errorf (
16991754 "%w: the TransportURL secret %s does not have 'transport_url' field" , util .ErrFieldNotFound , transportURL .Status .SecretName )
17001755 }
1701-
17021756 return string (url ), nova .MQCompleted , nil
17031757}
17041758
@@ -1902,13 +1956,15 @@ func (r *NovaReconciler) ensureCellSecret(
19021956 cellName string ,
19031957 cellTemplate novav1.NovaCellTemplate ,
19041958 cellTransportURL string ,
1959+ notificationTransportURL string ,
19051960 externalSecret corev1.Secret ,
19061961) (string , error ) {
19071962 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19081963 // the NovaCellSpec fields, possibly hostnames or usernames.
19091964 data := map [string ]string {
1910- ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1911- TransportURLSelector : cellTransportURL ,
1965+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
1966+ TransportURLSelector : cellTransportURL ,
1967+ NotificationTransportURLSelector : notificationTransportURL ,
19121968 }
19131969
19141970 // If metadata is enabled in the cell then the cell secret needs the
@@ -1952,14 +2008,16 @@ func (r *NovaReconciler) ensureTopLevelSecret(
19522008 h * helper.Helper ,
19532009 instance * novav1.Nova ,
19542010 apiTransportURL string ,
2011+ notificationTransportURL string ,
19552012 externalSecret corev1.Secret ,
19562013) (string , error ) {
19572014 // NOTE(gibi): We can move other sensitive data to the internal Secret from
19582015 // the subCR fields, possibly hostnames or usernames.
19592016 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 ,
2017+ ServicePasswordSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .Service ]),
2018+ MetadataSecretSelector : string (externalSecret .Data [instance .Spec .PasswordSelectors .MetadataSecret ]),
2019+ TransportURLSelector : apiTransportURL ,
2020+ NotificationTransportURLSelector : notificationTransportURL ,
19632021 }
19642022
19652023 // NOTE(gibi): When we switch to immutable secrets then we need to include
0 commit comments