Skip to content

Commit c90c928

Browse files
committed
Propagate rabbitmq user to nova-cellX secret
1 parent ebc58fb commit c90c928

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

internal/controller/novacell_controller.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,16 @@ func (r *NovaCellReconciler) generateComputeConfigs(
806806

807807
hashes := make(map[string]env.Setter)
808808

809+
// Propagate RabbitMQ user names to compute-config secret so the
810+
// openstack-operator can track which RabbitMQUser CRs are in use
811+
extraData := map[string]string{
812+
RabbitmqUserNameSelector: string(secret.Data[RabbitmqUserNameSelector]),
813+
NotificationRabbitmqUserNameSelector: string(secret.Data[NotificationRabbitmqUserNameSelector]),
814+
}
815+
809816
configName := instance.GetName() + "-compute-config"
810817
err := r.GenerateConfigs(
811-
ctx, h, instance, configName, &hashes, templateParameters, map[string]string{}, cmLabels, map[string]string{},
818+
ctx, h, instance, configName, &hashes, templateParameters, extraData, cmLabels, map[string]string{},
812819
)
813820
if err != nil {
814821
return err

test/functional/novacell_controller_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ var _ = Describe("NovaCell controller", func() {
339339
)
340340

341341
Expect(GetNovaCell(cell1.CellCRName).Status.Hash).To(HaveKey(cell1.ComputeConfigSecretName.Name))
342+
343+
// Verify that RabbitMQ user names are propagated to the compute-config secret
344+
// so the openstack-operator can track which RabbitMQUser CRs are in use
345+
Expect(computeConfigData.Data).To(
346+
HaveKey(controllers.RabbitmqUserNameSelector))
347+
Expect(computeConfigData.Data).To(
348+
HaveKey(controllers.NotificationRabbitmqUserNameSelector))
342349
})
343350

344351
It("should have quorum queues disabled by default and enabled when configured", func() {

0 commit comments

Comments
 (0)